dry_scaffold 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO.textile +0 -25
- data/generators/dry_model/templates/models/fixture_data/factory_girl_factories.rb +1 -1
- data/generators/dry_scaffold/dry_scaffold_generator.rb +2 -2
- data/generators/dry_scaffold/templates/controllers/tests/shoulda/functional_test.rb +3 -3
- data/generators/dry_scaffold/templates/views/haml/edit.html.haml +2 -2
- data/generators/dry_scaffold/templates/views/haml/index.html.haml +3 -3
- data/generators/dry_scaffold/templates/views/haml/new.html.haml +2 -2
- data/generators/dry_scaffold/templates/views/haml/show.html.haml +2 -2
- metadata +18 -9
data/TODO.textile
CHANGED
@@ -9,28 +9,3 @@ h2. Maybe
|
|
9
9
|
|
10
10
|
* Feature: Handle belongs_to, i.e. specify MODEL --belongs-to PARENT_MODEL, which generates proper routes, proper before-filters if inherited_resources-controller, adding belongs_to-association in model, and correct form_for arguments.
|
11
11
|
* Feature: Builder for podcast-feed, similar to RSS/Atom-builders. http://wiki.github.com/radiant/radiant/host-a-podcast
|
12
|
-
|
13
|
-
h2. Issues
|
14
|
-
|
15
|
-
* Contact José regarding the InheritedResources-issue:
|
16
|
-
|
17
|
-
ActionController::RoutingError: parrot_url failed to generate from {:controller=>"parrots", :id=>#<Parrot id: nil, name: "Hello", created_at: "2009-07-21 18:53:25", updated_at: "2009-07-21 18:53:25">, :action=>"show"}, expected: {:controller=>"parrots", :action=>"show"}, diff: {:id=>#<Parrot id: nil, name: "Hello", created_at: "2009-07-21 18:53:25", updated_at: "2009-07-21 18:53:25">}
|
18
|
-
(eval):16:in `parrot_url'
|
19
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/url_helpers.rb:194:in `resource_url'
|
20
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/base_helpers.rb:311:in `send'
|
21
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/base_helpers.rb:311:in `parse_redirect_url'
|
22
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/base.rb:79:in `create'
|
23
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/respond_to.rb:301:in `call'
|
24
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/respond_to.rb:301:in `respond_any'
|
25
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/respond_to.rb:233:in `respond_to'
|
26
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/base_helpers.rb:283:in `respond_to_with_dual_blocks'
|
27
|
-
/opt/local/lib/ruby/gems/1.8/gems/josevalim-inherited_resources-0.7.3/lib/inherited_resources/base.rb:78:in `create'
|
28
|
-
haml (2.0.9) rails/./lib/sass/plugin/rails.rb:19:in `process'
|
29
|
-
/test/functional/donkeys_controller_test.rb:8:in `test_create'
|
30
|
-
|
31
|
-
test 'create' do
|
32
|
-
Donkey.any_instance.expects(:save).returns(true)
|
33
|
-
@donkey = donkeys(:basic)
|
34
|
-
post :create, :donkey => @donkey.attributes # <<<<<<<<<<<<< donkeys_controller_test.rb:8
|
35
|
-
assert_response :redirect
|
36
|
-
end
|
@@ -226,11 +226,11 @@ class DryScaffoldGenerator < DryGenerator
|
|
226
226
|
### Link Helpers.
|
227
227
|
|
228
228
|
def collection_instance
|
229
|
-
"@#{collection_name}"
|
229
|
+
options[:resourceful] ? "#{collection_name}" : "@#{collection_name}"
|
230
230
|
end
|
231
231
|
|
232
232
|
def resource_instance
|
233
|
-
"@#{singular_name}"
|
233
|
+
options[:resourceful] ? "#{singular_name}" : "@#{singular_name}"
|
234
234
|
end
|
235
235
|
|
236
236
|
def index_path
|
@@ -9,7 +9,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
9
9
|
post :create, :<%= singular_name %> => <%= resource_instance %>.attributes
|
10
10
|
<%= resource_instance %> = <%= class_name %>.find(:all).last
|
11
11
|
end
|
12
|
-
should_redirect_to '<%= show_path %>
|
12
|
+
should_redirect_to("the <%= resource_instance %>'s show page") { <%= show_path %> }
|
13
13
|
end
|
14
14
|
|
15
15
|
<% end -%>
|
@@ -19,7 +19,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
19
19
|
<%= resource_instance %> = <%= build_object %>
|
20
20
|
put :update, :id => <%= resource_instance %>.to_param, :<%= singular_name %> => <%= resource_instance %>.attributes
|
21
21
|
end
|
22
|
-
should_redirect_to '<%= show_path %>
|
22
|
+
should_redirect_to("the <%= resource_instance %>'s show page") { <%= show_path %> }
|
23
23
|
end
|
24
24
|
|
25
25
|
<% end -%>
|
@@ -29,7 +29,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
29
29
|
<%= resource_instance %> = <%= build_object %>
|
30
30
|
delete :destroy, :id => <%= resource_instance %>.to_param
|
31
31
|
end
|
32
|
-
should_redirect_to '<%= index_path %>
|
32
|
+
should_redirect_to("the <%= resource_instance %>'s index page") { <%= index_path %> }
|
33
33
|
end
|
34
34
|
|
35
35
|
<% end -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%h1.heading
|
2
|
-
= "Editing <%=
|
2
|
+
= "Editing <%= model_singular_name %> %s" % <%= resource_instance %>.id
|
3
3
|
|
4
4
|
<% if options[:formtastic] -%>
|
5
5
|
- semantic_form_for(<%= resource_instance %>) do |form|
|
@@ -15,4 +15,4 @@
|
|
15
15
|
<% end -%>
|
16
16
|
|
17
17
|
%p.actions
|
18
|
-
= link_to 'Cancel', <%= index_path %>
|
18
|
+
= link_to 'Cancel', <%= index_path %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
%h1.heading
|
2
|
-
= "<%=
|
2
|
+
= "<%= model_plural_name.humanize %>"
|
3
3
|
|
4
4
|
%p.actions
|
5
|
-
= link_to 'New <%=
|
5
|
+
= link_to 'New <%= model_singular_name.humanize %>', <%= new_path %>
|
6
6
|
|
7
7
|
%table
|
8
8
|
%thead.header
|
@@ -17,4 +17,4 @@
|
|
17
17
|
|
18
18
|
<% if options[:pagination] -%>
|
19
19
|
= will_paginate(<%= collection_instance %>)
|
20
|
-
<% end -%>
|
20
|
+
<% end -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%h1.heading
|
2
|
-
= 'New <%=
|
2
|
+
= 'New <%= model_singular_name.humanize %>'
|
3
3
|
|
4
4
|
<% if options[:formtastic] -%>
|
5
5
|
- semantic_form_for(<%= resource_instance %>) do |form|
|
@@ -15,4 +15,4 @@
|
|
15
15
|
<% end -%>
|
16
16
|
|
17
17
|
%p.actions
|
18
|
-
= link_to 'Cancel', <%= index_path %>
|
18
|
+
= link_to 'Cancel', <%= index_path %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%h1.heading
|
2
|
-
= "<%=
|
2
|
+
= "<%= model_singular_name.humanize %> %s" % <%= resource_instance %>.id
|
3
3
|
|
4
4
|
- content_tag_for(:dl, <%= resource_instance %>) do
|
5
5
|
<% attributes.each do |attribute| -%>
|
@@ -10,4 +10,4 @@
|
|
10
10
|
%p.actions
|
11
11
|
= link_to 'Edit', <%= edit_path %>
|
12
12
|
|
|
13
|
-
= link_to 'Index', <%= index_path %>
|
13
|
+
= link_to 'Index', <%= index_path %>
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 8
|
9
|
+
version: 0.3.8
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Jonas Grimfelt
|
@@ -9,19 +14,21 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-03-21 00:00:00 +01:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: haml
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
25
32
|
description: A DRYer scaffold generator for Rails. Generates dry semantic and standards compliant views, and dry RESTful controllers.
|
26
33
|
email: grimen@gmail.com
|
27
34
|
executables:
|
@@ -121,18 +128,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
128
|
requirements:
|
122
129
|
- - ">="
|
123
130
|
- !ruby/object:Gem::Version
|
131
|
+
segments:
|
132
|
+
- 0
|
124
133
|
version: "0"
|
125
|
-
version:
|
126
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
135
|
requirements:
|
128
136
|
- - ">="
|
129
137
|
- !ruby/object:Gem::Version
|
138
|
+
segments:
|
139
|
+
- 0
|
130
140
|
version: "0"
|
131
|
-
version:
|
132
141
|
requirements: []
|
133
142
|
|
134
143
|
rubyforge_project:
|
135
|
-
rubygems_version: 1.3.
|
144
|
+
rubygems_version: 1.3.6
|
136
145
|
signing_key:
|
137
146
|
specification_version: 3
|
138
147
|
summary: A DRYer scaffold generator for Rails. Generates dry semantic and standards compliant views, and dry RESTful controllers.
|