comfy-admin-constructor 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +65 -17
- data/comfy-admin-constructor.gemspec +2 -2
- data/lib/comfy-admin-constructor/version.rb +1 -1
- metadata +4 -5
data/README.md
CHANGED
@@ -1,29 +1,77 @@
|
|
1
|
-
#
|
1
|
+
# ComfyAdminConstructor
|
2
2
|
|
3
|
-
|
3
|
+
**ComfyAdminConstructor** allows you to quickly and easily build basic admin interfaces in [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa).
|
4
4
|
|
5
|
-
|
5
|
+
Installation
|
6
|
+
------------
|
6
7
|
|
7
|
-
Add
|
8
|
+
Add gem definition to your **Gemfile**:
|
8
9
|
|
9
|
-
|
10
|
+
gem 'comfy-admin-constructor'
|
10
11
|
|
11
|
-
|
12
|
+
Then, from the Rails project's root run:
|
12
13
|
|
13
|
-
|
14
|
+
bundle install
|
14
15
|
|
15
|
-
|
16
|
+
Requirements
|
17
|
+
------------
|
16
18
|
|
17
|
-
|
19
|
+
There are plans to make CAC more flexible in the future, but right now it assumes a few things about your CMS install:
|
18
20
|
|
19
|
-
|
21
|
+
* You access CMS at **/admin** and not /cms-admin
|
22
|
+
* You use HAML and SASS
|
23
|
+
* You don't store your models in sub-directories
|
24
|
+
* Your admin controllers and views are stored in **controllers/admin** and **views/admin**, respectively
|
25
|
+
* Your CMS initializer will need to specify a custom navigation template at **views/admin/_navigation.html.haml***
|
20
26
|
|
21
|
-
|
27
|
+
Planned Features
|
28
|
+
----------------
|
22
29
|
|
23
|
-
|
30
|
+
* More flexibility in where/how things are created
|
31
|
+
* Basic passing tests
|
24
32
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
33
|
+
Quick Start Guide
|
34
|
+
-----------------
|
35
|
+
|
36
|
+
**Before proceeding make sure you have CMS up and running, taking into account the requirements above.** Make sure you've created your first site.
|
37
|
+
|
38
|
+
All done? Good. Let's walk through creating your first admin interface using CAC.
|
39
|
+
|
40
|
+
Let's say my application needs a way to create/edit event listings. Some of the fields we might need include:
|
41
|
+
|
42
|
+
* Event title
|
43
|
+
* Start date/time
|
44
|
+
* End date/time
|
45
|
+
* Description
|
46
|
+
* Location
|
47
|
+
|
48
|
+
With CAC, this is easy. In the root of the Rails project, we simply type:
|
49
|
+
|
50
|
+
rails g cms_admin EventListing title:string starts_at:datetime ends_at:datetime description:text location:string
|
51
|
+
|
52
|
+
CAC will automatically generate a bunch of files for us:
|
53
|
+
|
54
|
+
create app/models/event_listing.rb
|
55
|
+
create db/migrate/20120721145844_create_event_listings.rb
|
56
|
+
create app/controllers/admin/event_listings_controller.rb
|
57
|
+
create app/views/admin/event_listings/_form.html.haml
|
58
|
+
create app/views/admin/event_listings/edit.html.haml
|
59
|
+
create app/views/admin/event_listings/index.html.haml
|
60
|
+
create app/views/admin/event_listings/new.html.haml
|
61
|
+
route namespace(:admin){ resources :event_listings, :except => [:show] }
|
62
|
+
|
63
|
+
So, what happened there?
|
64
|
+
|
65
|
+
* The EventListing model was generated, with basic **:presence => :true** validation for all attributes
|
66
|
+
* A migration was generated to create the necessary table for our database (Note: Migrations are **never** run automatically. That's on you.)
|
67
|
+
* A controller, complete with ActiveRecord rescues, success/failure flash messages, and more.
|
68
|
+
* Views for all the operations we'll need, along with a form.
|
69
|
+
* Added a new route
|
70
|
+
* Appended a new link to the navigation template
|
71
|
+
|
72
|
+
That's it! CAC gives you all the basics. If you need to do something a little more complicated, it's easy to make any changes you like.
|
73
|
+
|
74
|
+
---
|
75
|
+
|
76
|
+
ComfortableMexicanSofa is released under the [MIT license](https://github.com/bgilham/comfy-admin-constructor/blob/master/LICENSE)
|
77
|
+
Copyright 2012 Brian Gilham, [The Working Group Inc](http://www.twg.ca)
|
@@ -4,8 +4,8 @@ require File.expand_path('../lib/comfy-admin-constructor/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Brian Gilham"]
|
6
6
|
gem.email = ["me@briangilham.com"]
|
7
|
-
gem.description = "
|
8
|
-
gem.summary = "Comfy Admin Constructor - Create CMS admin sections in one line
|
7
|
+
gem.description = "ComfyAdminConstructor allows you to quickly and easily build basic admin interfaces in ComfortableMexicanSofa."
|
8
|
+
gem.summary = "Comfy Admin Constructor - Create CMS admin sections in one line"
|
9
9
|
gem.homepage = "https://github.com/bgilham/comfy-admin-constructor"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfy-admin-constructor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,8 +11,8 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-07-21 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
15
|
-
|
14
|
+
description: ComfyAdminConstructor allows you to quickly and easily build basic admin
|
15
|
+
interfaces in ComfortableMexicanSofa.
|
16
16
|
email:
|
17
17
|
- me@briangilham.com
|
18
18
|
executables: []
|
@@ -69,6 +69,5 @@ rubyforge_project:
|
|
69
69
|
rubygems_version: 1.8.17
|
70
70
|
signing_key:
|
71
71
|
specification_version: 3
|
72
|
-
summary: Comfy Admin Constructor - Create CMS admin sections in one line
|
73
|
-
FOR USE***
|
72
|
+
summary: Comfy Admin Constructor - Create CMS admin sections in one line
|
74
73
|
test_files: []
|