active_leonardo 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +55 -50
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98288c6c808eb562a554c00073aeb8aede9f0427
|
4
|
+
data.tar.gz: 686b0fa1d863a8f53ab72f041899cead31ae1e6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3e59d5d42eb1ebad1eae04837940bd63a47d51107052653962dea613c0d19550c38c554cc6754651aa9ed1e08fe4ff40acb06d53e11b2fcb6e95c03f14245b
|
7
|
+
data.tar.gz: 8b5c79a497b344cd9da8c2fc230e6e740370bdc63f025addc45f513a8ec22adb76eae91736a4598b7518adc9b7506798a95572db6b794ff5517cfde32f744a40
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
0.8.1 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.8.0...v0.8.1) February 18th, 2016
|
2
|
+
------------------------------
|
3
|
+
* Improved the documentation
|
4
|
+
* Fixed a bug on the travis test
|
5
|
+
|
1
6
|
0.8.0 [☰](https://github.com/marcomd/Active_Leonardo/compare/v0.7.0...v0.8.0) February 17th, 2016
|
2
7
|
------------------------------
|
3
8
|
* Permitted params now use the _id suffix for foreign key fields, in this way the parent resourse can be saved
|
data/README.md
CHANGED
@@ -30,18 +30,26 @@ You can also get it from the gem root folder
|
|
30
30
|
|
31
31
|
Once you install the gem, the generators will be available to all Rails applications on your system.
|
32
32
|
|
33
|
-
To run the generator, go to your rails project directory and type:
|
33
|
+
To run the generator, go to your rails project directory and type to generate the layout:
|
34
34
|
|
35
|
-
rails generate leolay
|
36
|
-
|
35
|
+
rails generate leolay
|
36
|
+
|
37
|
+
Then type to generate the resource:
|
38
|
+
|
39
|
+
rails generate leosca
|
40
|
+
|
41
|
+
You can revert:
|
37
42
|
|
38
|
-
|
43
|
+
rails destroy leosca
|
44
|
+
|
45
|
+
You can generate and destroy more times until you will get your prototype.
|
46
|
+
|
47
|
+
Read the follow _Step by step_ paragraph and the next _Massive resources generation_
|
39
48
|
|
40
|
-
**Warning**: Leosca destroy do not remove variables parts inserted into feed like time values.
|
41
49
|
|
42
50
|
### Step by step
|
43
51
|
|
44
|
-
1.
|
52
|
+
1. Create the app and the layout:
|
45
53
|
|
46
54
|
rails new ActiveLeo -m YOUR_TEMPLATE_PATH (see above: install paragraph)
|
47
55
|
|
@@ -87,7 +95,7 @@ You can run it more times and right like scaffold, it's smart and won't generate
|
|
87
95
|
There is a fourth profile for _guest_ users who can only see the data. In addition to these you can create all the profiles you need according to cancan rules.
|
88
96
|
|
89
97
|
|
90
|
-
3. Create your resource:
|
98
|
+
3. Create your resource as this example:
|
91
99
|
|
92
100
|
rails g leosca product name:string description:text active:boolean items:integer price:decimal
|
93
101
|
|
@@ -98,44 +106,16 @@ You can run it more times and right like scaffold, it's smart and won't generate
|
|
98
106
|
3. seeds will be created for you to populate new table
|
99
107
|
4. invoke active admin generator to add the new resource with a custom configuration to work with cancan
|
100
108
|
|
109
|
+
Draper is not directly supported but if you have installed it will be triggers in the resource generation chain.
|
101
110
|
|
102
|
-
4. Apply to db
|
111
|
+
4. Apply to db:
|
103
112
|
|
104
113
|
rake db:migrate
|
105
114
|
rake db:seed
|
106
115
|
|
107
116
|
That's all!
|
108
|
-
The new application is ready to be customized to suit your needs:
|
109
|
-
|
110
|
-
* start to develop user front end
|
111
|
-
* take advantage of active admin and its dsl to quickly setup administration section
|
112
|
-
|
113
117
|
|
114
|
-
|
115
|
-
You could also customize leonardo templates both views and controller.
|
116
|
-
To copy under your project folder run:
|
117
|
-
|
118
|
-
rails g leosca:install
|
119
|
-
|
120
|
-
Then go to
|
121
|
-
|
122
|
-
lib\generators\erb
|
123
|
-
|
124
|
-
to edit erb views like you would do with original scaffold.
|
125
|
-
Go to
|
126
|
-
|
127
|
-
lib\generators\rails
|
128
|
-
|
129
|
-
if you want to customize more.
|
130
|
-
|
131
|
-
|
132
|
-
For more information about usage:
|
133
|
-
|
134
|
-
rails g leolay --help
|
135
|
-
rails g leosca --help
|
136
|
-
|
137
|
-
|
138
|
-
### Example:
|
118
|
+
### Other examples:
|
139
119
|
|
140
120
|
leolay:
|
141
121
|
|
@@ -148,20 +128,19 @@ leosca:
|
|
148
128
|
rails generate leosca product name:string --skip-seeds
|
149
129
|
rails generate leosca product name:string --seeds=60 => if you need more records
|
150
130
|
|
151
|
-
if you made a mistake and want to start from scratch just replace generate with destroy to remove all files and inserted code
|
152
131
|
|
153
|
-
|
132
|
+
## Massive resources generation
|
154
133
|
|
155
|
-
|
134
|
+
Write the resources you want to generate into the file **scaffold.txt** and put it in the _root_.
|
135
|
+
A line for every resource, starting from the beginning with the name as you would do with the scaffold.
|
156
136
|
|
157
|
-
Write the resources you want to generate into the file scaffold.txt in the root app.
|
158
|
-
A line for every resource, starting from the beginning with the name as you would with the scaffold.
|
159
137
|
If the line is not a resource but another generator, you can simply starting with the full rails command.
|
138
|
+
|
160
139
|
Example:
|
161
140
|
|
162
|
-
# This is the main resource... i
|
141
|
+
# This is the main resource... (but i could change my mind)
|
163
142
|
activity user:references name:string{100} body:text completed:boolean percentage_progression:integer{1}
|
164
|
-
#completed: when all tasks are completed
|
143
|
+
# completed: when all sub tasks are completed
|
165
144
|
# Any other comments about fields
|
166
145
|
|
167
146
|
# This table acts as...
|
@@ -199,6 +178,30 @@ This is very useful for a rapid prototyping and if you keep it updated you can u
|
|
199
178
|
|
200
179
|
_If you try that example remember to add the traslation of the two field foo and bar (added by migrations), otherwise you will get a translation error._
|
201
180
|
|
181
|
+
## Customization
|
182
|
+
|
183
|
+
You could also customize leonardo templates both views and controller.
|
184
|
+
To copy under your project folder run:
|
185
|
+
|
186
|
+
rails g leosca:install
|
187
|
+
|
188
|
+
Then go to
|
189
|
+
|
190
|
+
lib\generators\erb
|
191
|
+
|
192
|
+
to edit erb views like you would do with original scaffold.
|
193
|
+
Go to
|
194
|
+
|
195
|
+
lib\generators\rails
|
196
|
+
|
197
|
+
if you want to customize more.
|
198
|
+
|
199
|
+
|
200
|
+
For more information about usage:
|
201
|
+
|
202
|
+
rails g leolay --help
|
203
|
+
rails g leosca --help
|
204
|
+
|
202
205
|
### Available layout
|
203
206
|
|
204
207
|
Currently the only one available is provided by ActiveAdmin
|
@@ -263,27 +266,29 @@ rake active:tests:newapp[inspection,4.2]
|
|
263
266
|
|
264
267
|
Do **NOT** exec rake tests from bundle to avoid its bubble.
|
265
268
|
|
266
|
-
##
|
269
|
+
## Compatibility with older versions
|
270
|
+
|
271
|
+
#### Ruby 1.9
|
267
272
|
|
268
273
|
Supported until 0.6.x version
|
269
274
|
|
270
275
|
|
271
|
-
|
276
|
+
#### Rails 3.2.x
|
272
277
|
|
273
278
|
Supported until 0.6.x version
|
274
279
|
|
275
280
|
|
276
|
-
|
281
|
+
#### Rails 3.1.x
|
277
282
|
|
278
283
|
It should work but has not been tested
|
279
284
|
|
280
285
|
|
281
|
-
|
286
|
+
#### Rails 2 and Rails 3.0.x
|
282
287
|
|
283
288
|
This Generators does not work with versions earlier 3.1
|
284
289
|
|
285
290
|
|
286
|
-
##
|
291
|
+
## Other informations
|
287
292
|
|
288
293
|
Visit my [Blog](http://en-marcomastrodonato.blogspot.it/2012/08/create-management-app-with-activeadmin-rails.html/)
|
289
294
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_leonardo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Mastrodonato
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|