stefanpenner-my_scaffold 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml
CHANGED
data/generators/my_model/USAGE
CHANGED
@@ -14,7 +14,7 @@ Description:
|
|
14
14
|
db/migrate.
|
15
15
|
|
16
16
|
Examples:
|
17
|
-
`./script/generate
|
17
|
+
`./script/generate my_model account`
|
18
18
|
|
19
19
|
creates an Account model, test, factory, and migration:
|
20
20
|
Model: app/models/account.rb
|
@@ -22,6 +22,6 @@ Examples:
|
|
22
22
|
Factory: test/factories/account_factory.rb
|
23
23
|
Migration: db/migrate/XXX_add_accounts.rb
|
24
24
|
|
25
|
-
`./script/generate
|
25
|
+
`./script/generate my_model post title:string body:text published:boolean`
|
26
26
|
|
27
27
|
creates a Post model with a string title, text body, and published flag.
|
@@ -13,22 +13,22 @@ Description:
|
|
13
13
|
You don't have to think up every attribute up front, but it helps to
|
14
14
|
sketch out a few so you can start working with the resource immediately.
|
15
15
|
|
16
|
-
For example, `
|
16
|
+
For example, `my_scaffold post title:string body:text published:boolean`
|
17
17
|
gives you a model with those three attributes, a controller that handles
|
18
18
|
the create/show/update/destroy, forms to create and edit your posts, and
|
19
19
|
an index that lists them all, as well as a map.resources :posts
|
20
20
|
declaration in config/routes.rb.
|
21
21
|
|
22
22
|
You can override the default values for templating and
|
23
|
-
functional\_test\_style by placing a .
|
23
|
+
functional\_test\_style by placing a .my\_generator file in your home
|
24
24
|
directory.
|
25
25
|
|
26
|
-
Here's an example `.
|
26
|
+
Here's an example `.my_generator`:
|
27
27
|
|
28
|
-
:templating:
|
28
|
+
:templating: haml # supported options: haml|erb
|
29
29
|
:functional_test_syle: basic # supported options: should_be_restful|basic
|
30
30
|
|
31
31
|
Examples:
|
32
|
-
`./script/generate
|
33
|
-
`./script/generate
|
34
|
-
`./script/generate
|
32
|
+
`./script/generate my_scaffold post` # no attributes, view will be anemic
|
33
|
+
`./script/generate my_scaffold post title:string body:text published:boolean`
|
34
|
+
`./script/generate my_scaffold purchase order_id:integer amount:decimal`
|
@@ -40,7 +40,8 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
40
40
|
def destroy
|
41
41
|
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
42
42
|
@<%= file_name %>.destroy
|
43
|
-
|
43
|
+
|
44
|
+
flash[:success] = "User @<%= file_name %> was removed"
|
44
45
|
redirect_to(<%= table_name %>_url)
|
45
46
|
end
|
46
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stefanpenner-my_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Penner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-12 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|