view_mapper 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/README.rdoc +3 -1
  2. data/VERSION +1 -1
  3. data/lib/view_mapper.rb +1 -0
  4. data/lib/view_mapper/belongs_to_parent_models.rb +12 -26
  5. data/lib/view_mapper/has_many_child_models.rb +9 -9
  6. data/lib/view_mapper/model_info.rb +56 -18
  7. data/lib/view_mapper/views/belongs_to/belongs_to_view.rb +14 -0
  8. data/lib/view_mapper/views/belongs_to_auto_complete/belongs_to_auto_complete_view.rb +9 -2
  9. data/lib/view_mapper/views/has_many/templates/helper.rb +1 -1
  10. data/lib/view_mapper/views/has_many/templates/view_child_form.html.erb +1 -1
  11. data/lib/view_mapper/views/has_many/templates/view_form.html.erb +1 -1
  12. data/lib/view_mapper/views/has_many_existing/has_many_existing_view.rb +126 -0
  13. data/lib/view_mapper/views/has_many_existing/templates/model.rb +21 -0
  14. data/lib/view_mapper/views/has_many_existing/templates/view_child_form.html.erb +16 -0
  15. data/lib/view_mapper/views/has_many_existing/templates/view_form.html.erb +20 -0
  16. data/lib/view_mapper/views/has_many_existing/templates/view_show.html.erb +26 -0
  17. data/test/generators/scaffold_for_view/scaffold_for_view_generator_test.rb +15 -15
  18. data/test/generators/view_for/view_for_generator_test.rb +18 -18
  19. data/test/model_info_test.rb +91 -20
  20. data/test/test_helper.rb +75 -105
  21. data/test/views/auto_complete/auto_complete_test.rb +104 -102
  22. data/test/views/auto_complete/expected_templates/edit.html.erb +6 -6
  23. data/test/views/auto_complete/expected_templates/expected_routes.rb +1 -1
  24. data/test/views/auto_complete/expected_templates/index.html.erb +10 -10
  25. data/test/views/auto_complete/expected_templates/new.html.erb +5 -5
  26. data/test/views/auto_complete/expected_templates/show.html.erb +6 -6
  27. data/test/views/auto_complete/expected_templates/{testies.html.erb → test_models.html.erb} +1 -1
  28. data/test/views/auto_complete/expected_templates/test_models_controller.rb +89 -0
  29. data/test/views/belongs_to/belongs_to_test.rb +238 -202
  30. data/test/views/belongs_to/expected_templates/_form.html.erb +4 -4
  31. data/test/views/belongs_to/expected_templates/child_model.rb +10 -0
  32. data/test/views/belongs_to/expected_templates/create_child_models.rb +18 -0
  33. data/test/views/belongs_to/expected_templates/edit.html.erb +4 -4
  34. data/test/views/belongs_to/expected_templates/index.html.erb +11 -11
  35. data/test/views/belongs_to/expected_templates/new.html.erb +3 -3
  36. data/test/views/belongs_to/expected_templates/show.html.erb +7 -7
  37. data/test/views/belongs_to_auto_complete/belongs_to_auto_complete_test.rb +440 -406
  38. data/test/views/belongs_to_auto_complete/expected_templates/_form.html.erb +4 -4
  39. data/test/views/belongs_to_auto_complete/expected_templates/child_model.rb +16 -0
  40. data/test/views/belongs_to_auto_complete/expected_templates/{some_other_models.html.erb → child_models.html.erb} +1 -1
  41. data/test/views/belongs_to_auto_complete/expected_templates/child_models_controller.rb +89 -0
  42. data/test/views/belongs_to_auto_complete/expected_templates/create_child_models.rb +18 -0
  43. data/test/views/belongs_to_auto_complete/expected_templates/edit.html.erb +4 -4
  44. data/test/views/belongs_to_auto_complete/expected_templates/expected_routes.rb +2 -2
  45. data/test/views/belongs_to_auto_complete/expected_templates/index.html.erb +11 -11
  46. data/test/views/belongs_to_auto_complete/expected_templates/new.html.erb +3 -3
  47. data/test/views/belongs_to_auto_complete/expected_templates/show.html.erb +7 -7
  48. data/test/views/has_many/expected_templates/_form.html.erb +8 -8
  49. data/test/views/has_many/expected_templates/{_person.html.erb → _second_child_model.html.erb} +5 -5
  50. data/test/views/has_many/expected_templates/create_parent_models.rb +16 -0
  51. data/test/views/has_many/expected_templates/edit.html.erb +4 -4
  52. data/test/views/has_many/expected_templates/index.html.erb +7 -7
  53. data/test/views/has_many/expected_templates/new.html.erb +3 -3
  54. data/test/views/has_many/expected_templates/{parent.rb → parent_model.rb} +5 -5
  55. data/test/views/has_many/expected_templates/show.html.erb +15 -15
  56. data/test/views/has_many/has_many_view_test.rb +334 -292
  57. data/test/views/has_many_existing/expected_templates/_assignment.html.erb +14 -0
  58. data/test/views/has_many_existing/expected_templates/_form.html.erb +16 -0
  59. data/test/views/{has_many/expected_templates/create_parents.rb → has_many_existing/expected_templates/create_programmers.rb} +3 -3
  60. data/test/views/has_many_existing/expected_templates/edit.html.erb +11 -0
  61. data/test/views/has_many_existing/expected_templates/index.html.erb +20 -0
  62. data/test/views/has_many_existing/expected_templates/new.html.erb +10 -0
  63. data/test/views/has_many_existing/expected_templates/programmer.rb +10 -0
  64. data/test/views/has_many_existing/expected_templates/show.html.erb +20 -0
  65. data/test/views/has_many_existing/has_many_existing_test.rb +495 -0
  66. data/test/views/paperclip/expected_templates/{create_testies.rb → create_test_models.rb} +3 -3
  67. data/test/views/paperclip/expected_templates/edit.html.erb +4 -4
  68. data/test/views/paperclip/expected_templates/index.html.erb +10 -10
  69. data/test/views/paperclip/expected_templates/new.html.erb +3 -3
  70. data/test/views/paperclip/expected_templates/show.html.erb +8 -8
  71. data/test/views/paperclip/expected_templates/{testy.rb → test_model.rb} +1 -1
  72. data/test/views/paperclip/paperclip_view_test.rb +254 -226
  73. data/view_mapper.gemspec +43 -27
  74. metadata +64 -37
  75. data/test/views/auto_complete/expected_templates/actual_index +0 -26
  76. data/test/views/auto_complete/expected_templates/testies_controller.rb +0 -89
  77. data/test/views/belongs_to/expected_templates/create_some_other_models.rb +0 -18
  78. data/test/views/belongs_to/expected_templates/some_other_model.rb +0 -10
  79. data/test/views/belongs_to_auto_complete/expected_templates/create_some_other_models.rb +0 -18
  80. data/test/views/belongs_to_auto_complete/expected_templates/some_other_model.rb +0 -16
  81. data/test/views/belongs_to_auto_complete/expected_templates/some_other_models_controller.rb +0 -89
@@ -4,10 +4,10 @@
4
4
  <%= f.text_field :name %>
5
5
  </p>
6
6
  <p>
7
- Parent:<br />
8
- <%= text_field_with_auto_complete :some_other_model, :parent_name, {}, { :method => :get, :url => '/auto_complete_for_parent_name', :param_name => 'parent[name]' } %>
7
+ Parent Model:<br />
8
+ <%= text_field_with_auto_complete :child_model, :parent_model_name, {}, { :method => :get, :url => '/auto_complete_for_parent_model_name', :param_name => 'parent_model[name]' } %>
9
9
  </p>
10
10
  <p>
11
- Second Parent:<br />
12
- <%= text_field_with_auto_complete :some_other_model, :second_parent_other_field, {}, { :method => :get, :url => '/auto_complete_for_second_parent_other_field', :param_name => 'second_parent[other_field]' } %>
11
+ Second Parent Model:<br />
12
+ <%= text_field_with_auto_complete :child_model, :second_parent_model_other_field, {}, { :method => :get, :url => '/auto_complete_for_second_parent_model_other_field', :param_name => 'second_parent_model[other_field]' } %>
13
13
  </p>
@@ -0,0 +1,16 @@
1
+ class ChildModel < ActiveRecord::Base
2
+ belongs_to :parent_model
3
+ belongs_to :second_parent_model
4
+ def parent_model_name
5
+ parent_model.name if parent_model
6
+ end
7
+ def parent_model_name=(name)
8
+ self.parent_model = ParentModel.find_by_name(name)
9
+ end
10
+ def second_parent_model_other_field
11
+ second_parent_model.other_field if second_parent_model
12
+ end
13
+ def second_parent_model_other_field=(other_field)
14
+ self.second_parent_model = SecondParentModel.find_by_other_field(other_field)
15
+ end
16
+ end
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
6
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
- <title>SomeOtherModels: <%= controller.action_name %></title>
7
+ <title>ChildModels: <%= controller.action_name %></title>
8
8
  <%= stylesheet_link_tag 'scaffold' %>
9
9
  <%= javascript_include_tag :defaults %>
10
10
  </head>
@@ -0,0 +1,89 @@
1
+ class ChildModelsController < ApplicationController
2
+
3
+ auto_complete_for :parent_model, :name
4
+ auto_complete_for :second_parent_model, :other_field
5
+
6
+ # GET /child_models
7
+ # GET /child_models.xml
8
+ def index
9
+ @child_models = ChildModel.all
10
+
11
+ respond_to do |format|
12
+ format.html # index.html.erb
13
+ format.xml { render :xml => @child_models }
14
+ end
15
+ end
16
+
17
+ # GET /child_models/1
18
+ # GET /child_models/1.xml
19
+ def show
20
+ @child_model = ChildModel.find(params[:id])
21
+
22
+ respond_to do |format|
23
+ format.html # show.html.erb
24
+ format.xml { render :xml => @child_model }
25
+ end
26
+ end
27
+
28
+ # GET /child_models/new
29
+ # GET /child_models/new.xml
30
+ def new
31
+ @child_model = ChildModel.new
32
+
33
+ respond_to do |format|
34
+ format.html # new.html.erb
35
+ format.xml { render :xml => @child_model }
36
+ end
37
+ end
38
+
39
+ # GET /child_models/1/edit
40
+ def edit
41
+ @child_model = ChildModel.find(params[:id])
42
+ end
43
+
44
+ # POST /child_models
45
+ # POST /child_models.xml
46
+ def create
47
+ @child_model = ChildModel.new(params[:child_model])
48
+
49
+ respond_to do |format|
50
+ if @child_model.save
51
+ flash[:notice] = 'ChildModel was successfully created.'
52
+ format.html { redirect_to(@child_model) }
53
+ format.xml { render :xml => @child_model, :status => :created, :location => @child_model }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.xml { render :xml => @child_model.errors, :status => :unprocessable_entity }
57
+ end
58
+ end
59
+ end
60
+
61
+ # PUT /child_models/1
62
+ # PUT /child_models/1.xml
63
+ def update
64
+ @child_model = ChildModel.find(params[:id])
65
+
66
+ respond_to do |format|
67
+ if @child_model.update_attributes(params[:child_model])
68
+ flash[:notice] = 'ChildModel was successfully updated.'
69
+ format.html { redirect_to(@child_model) }
70
+ format.xml { head :ok }
71
+ else
72
+ format.html { render :action => "edit" }
73
+ format.xml { render :xml => @child_model.errors, :status => :unprocessable_entity }
74
+ end
75
+ end
76
+ end
77
+
78
+ # DELETE /child_models/1
79
+ # DELETE /child_models/1.xml
80
+ def destroy
81
+ @child_model = ChildModel.find(params[:id])
82
+ @child_model.destroy
83
+
84
+ respond_to do |format|
85
+ format.html { redirect_to(child_models_url) }
86
+ format.xml { head :ok }
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,18 @@
1
+ class CreateChildModels < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :child_models do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.string :address
7
+ t.boolean :some_flag
8
+ t.integer :parent_model_id
9
+ t.integer :second_parent_model_id
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+
15
+ def self.down
16
+ drop_table :child_models
17
+ end
18
+ end
@@ -1,11 +1,11 @@
1
- <h1>Editing some_other_model</h1>
1
+ <h1>Editing child_model</h1>
2
2
 
3
- <% form_for(@some_other_model) do |f| %>
3
+ <% form_for(@child_model) do |f| %>
4
4
  <%= render :partial => 'form', :locals => { :f => f } %>
5
5
  <p>
6
6
  <%= f.submit 'Update' %>
7
7
  </p>
8
8
  <% end %>
9
9
 
10
- <%= link_to 'Show', @some_other_model %> |
11
- <%= link_to 'Back', some_other_models_path %>
10
+ <%= link_to 'Show', @child_model %> |
11
+ <%= link_to 'Back', child_models_path %>
@@ -1,7 +1,7 @@
1
1
  ActionController::Routing::Routes.draw do |map|
2
- map.connect 'auto_complete_for_parent_name', :controller => 'some_other_models', :action => 'auto_complete_for_parent_name'
2
+ map.connect 'auto_complete_for_parent_model_name', :controller => 'child_models', :action => 'auto_complete_for_parent_model_name'
3
3
 
4
- map.connect 'auto_complete_for_second_parent_other_field', :controller => 'some_other_models', :action => 'auto_complete_for_second_parent_other_field'
4
+ map.connect 'auto_complete_for_second_parent_model_other_field', :controller => 'child_models', :action => 'auto_complete_for_second_parent_model_other_field'
5
5
 
6
6
  # The priority is based upon order of creation: first created -> highest priority.
7
7
 
@@ -1,24 +1,24 @@
1
- <h1>Listing some_other_models</h1>
1
+ <h1>Listing child_models</h1>
2
2
 
3
3
  <table>
4
4
  <tr>
5
5
  <th>Name</th>
6
- <th>Parent</th>
7
- <th>Second Parent</th>
6
+ <th>Parent Model</th>
7
+ <th>Second Parent Model</th>
8
8
  </tr>
9
9
 
10
- <% @some_other_models.each do |some_other_model| %>
10
+ <% @child_models.each do |child_model| %>
11
11
  <tr>
12
- <td><%=h some_other_model.name %></td>
13
- <td><%=h some_other_model.parent_name %></td>
14
- <td><%=h some_other_model.second_parent_other_field %></td>
15
- <td><%= link_to 'Show', some_other_model %></td>
16
- <td><%= link_to 'Edit', edit_some_other_model_path(some_other_model) %></td>
17
- <td><%= link_to 'Destroy', some_other_model, :confirm => 'Are you sure?', :method => :delete %></td>
12
+ <td><%=h child_model.name %></td>
13
+ <td><%=h child_model.parent_model_name %></td>
14
+ <td><%=h child_model.second_parent_model_other_field %></td>
15
+ <td><%= link_to 'Show', child_model %></td>
16
+ <td><%= link_to 'Edit', edit_child_model_path(child_model) %></td>
17
+ <td><%= link_to 'Destroy', child_model, :confirm => 'Are you sure?', :method => :delete %></td>
18
18
  </tr>
19
19
  <% end %>
20
20
  </table>
21
21
 
22
22
  <br />
23
23
 
24
- <%= link_to 'New some_other_model', new_some_other_model_path %>
24
+ <%= link_to 'New child_model', new_child_model_path %>
@@ -1,10 +1,10 @@
1
- <h1>New some_other_model</h1>
1
+ <h1>New child_model</h1>
2
2
 
3
- <% form_for(@some_other_model) do |f| %>
3
+ <% form_for(@child_model) do |f| %>
4
4
  <%= render :partial => 'form', :locals => { :f => f } %>
5
5
  <p>
6
6
  <%= f.submit 'Create' %>
7
7
  </p>
8
8
  <% end %>
9
9
 
10
- <%= link_to 'Back', some_other_models_path %>
10
+ <%= link_to 'Back', child_models_path %>
@@ -1,17 +1,17 @@
1
1
  <p>
2
2
  <b>Name:</b>
3
- <%=h @some_other_model.name %>
3
+ <%=h @child_model.name %>
4
4
  </p>
5
5
 
6
6
  <p>
7
- <b>Parent:</b>
8
- <%=h @some_other_model.parent_name %>
7
+ <b>Parent Model:</b>
8
+ <%=h @child_model.parent_model_name %>
9
9
  </p>
10
10
 
11
11
  <p>
12
- <b>Second Parent:</b>
13
- <%=h @some_other_model.second_parent_other_field %>
12
+ <b>Second Parent Model:</b>
13
+ <%=h @child_model.second_parent_model_other_field %>
14
14
  </p>
15
15
 
16
- <%= link_to 'Edit', edit_some_other_model_path(@some_other_model) %> |
17
- <%= link_to 'Back', some_other_models_path %>
16
+ <%= link_to 'Edit', edit_child_model_path(@child_model) %> |
17
+ <%= link_to 'Back', child_models_path %>
@@ -5,22 +5,22 @@
5
5
  <%= f.text_field :name %>
6
6
  </p>
7
7
 
8
- <div id='some_other_model_children'>
9
- <% f.fields_for :some_other_models do |some_other_model_form| %>
10
- <%= render :partial => 'some_other_model', :locals => { :f => some_other_model_form } %>
8
+ <div id='child_model_children'>
9
+ <% f.fields_for :child_models do |child_model_form| %>
10
+ <%= render :partial => 'child_model', :locals => { :f => child_model_form } %>
11
11
  <% end %>
12
12
  </div>
13
13
 
14
14
  <p>
15
- <%= add_child_link 'Add a SomeOtherModel', 'some_other_model', f %>
15
+ <%= add_child_link 'Add ChildModel', 'child_model', f %>
16
16
  </p>
17
17
 
18
- <div id='testy_children'>
19
- <% f.fields_for :testies do |testy_form| %>
20
- <%= render :partial => 'testy', :locals => { :f => testy_form } %>
18
+ <div id='second_child_model_children'>
19
+ <% f.fields_for :second_child_models do |second_child_model_form| %>
20
+ <%= render :partial => 'second_child_model', :locals => { :f => second_child_model_form } %>
21
21
  <% end %>
22
22
  </div>
23
23
 
24
24
  <p>
25
- <%= add_child_link 'Add a Testy', 'testy', f %>
25
+ <%= add_child_link 'Add SecondChildModel', 'second_child_model', f %>
26
26
  </p>
@@ -1,22 +1,22 @@
1
1
  <div class="child">
2
2
  <p>
3
- Testy <%= f.label :first_name %><br />
3
+ SecondChildModel <%= f.label :first_name %><br />
4
4
  <%= f.text_field :first_name %>
5
5
  </p>
6
6
  <p>
7
- Testy <%= f.label :last_name %><br />
7
+ SecondChildModel <%= f.label :last_name %><br />
8
8
  <%= f.text_field :last_name %>
9
9
  </p>
10
10
  <p>
11
- Testy <%= f.label :address %><br />
11
+ SecondChildModel <%= f.label :address %><br />
12
12
  <%= f.text_field :address %>
13
13
  </p>
14
14
  <p>
15
- Testy <%= f.label :some_flag %><br />
15
+ SecondChildModel <%= f.label :some_flag %><br />
16
16
  <%= f.check_box :some_flag %>
17
17
  </p>
18
18
  <p>
19
- <%= f.hidden_field :_delete, :class => 'delete' %>
19
+ <%= f.hidden_field :_destroy, :class => 'delete' %>
20
20
  <%= remove_child_link 'remove', f %>
21
21
  </p>
22
22
  </div>
@@ -0,0 +1,16 @@
1
+ class CreateParentModels < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :parent_models do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.string :address
7
+ t.boolean :some_flag
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :parent_models
15
+ end
16
+ end
@@ -1,11 +1,11 @@
1
- <h1>Editing parent</h1>
1
+ <h1>Editing parent_model</h1>
2
2
 
3
- <% form_for(@parent) do |f| %>
3
+ <% form_for(@parent_model) do |f| %>
4
4
  <%= render :partial => 'form', :locals => { :f => f } %>
5
5
  <p>
6
6
  <%= f.submit 'Update' %>
7
7
  </p>
8
8
  <% end %>
9
9
 
10
- <%= link_to 'Show', @parent %> |
11
- <%= link_to 'Back', parents_path %>
10
+ <%= link_to 'Show', @parent_model %> |
11
+ <%= link_to 'Back', parent_models_path %>
@@ -1,20 +1,20 @@
1
- <h1>Listing parents</h1>
1
+ <h1>Listing parent_models</h1>
2
2
 
3
3
  <table>
4
4
  <tr>
5
5
  <th>Name</th>
6
6
  </tr>
7
7
 
8
- <% @parents.each do |parent| %>
8
+ <% @parent_models.each do |parent_model| %>
9
9
  <tr>
10
- <td><%=h parent.name %></td>
11
- <td><%= link_to 'Show', parent %></td>
12
- <td><%= link_to 'Edit', edit_parent_path(parent) %></td>
13
- <td><%= link_to 'Destroy', parent, :confirm => 'Are you sure?', :method => :delete %></td>
10
+ <td><%=h parent_model.name %></td>
11
+ <td><%= link_to 'Show', parent_model %></td>
12
+ <td><%= link_to 'Edit', edit_parent_model_path(parent_model) %></td>
13
+ <td><%= link_to 'Destroy', parent_model, :confirm => 'Are you sure?', :method => :delete %></td>
14
14
  </tr>
15
15
  <% end %>
16
16
  </table>
17
17
 
18
18
  <br />
19
19
 
20
- <%= link_to 'New parent', new_parent_path %>
20
+ <%= link_to 'New parent_model', new_parent_model_path %>
@@ -1,10 +1,10 @@
1
- <h1>New parent</h1>
1
+ <h1>New parent_model</h1>
2
2
 
3
- <% form_for(@parent) do |f| %>
3
+ <% form_for(@parent_model) do |f| %>
4
4
  <%= render :partial => 'form', :locals => { :f => f } %>
5
5
  <p>
6
6
  <%= f.submit 'Create' %>
7
7
  </p>
8
8
  <% end %>
9
9
 
10
- <%= link_to 'Back', parents_path %>
10
+ <%= link_to 'Back', parent_models_path %>
@@ -1,10 +1,10 @@
1
- class Parent < ActiveRecord::Base
2
- has_many :some_other_models
3
- has_many :testies
4
- accepts_nested_attributes_for :some_other_models,
1
+ class ParentModel < ActiveRecord::Base
2
+ has_many :child_models
3
+ has_many :second_child_models
4
+ accepts_nested_attributes_for :child_models,
5
5
  :allow_destroy => true,
6
6
  :reject_if => proc { |attrs| attrs['name'].blank? }
7
- accepts_nested_attributes_for :testies,
7
+ accepts_nested_attributes_for :second_child_models,
8
8
  :allow_destroy => true,
9
9
  :reject_if => proc { |attrs|
10
10
  attrs['first_name'].blank? &&
@@ -1,37 +1,37 @@
1
1
  <p>
2
2
  <b>Name:</b>
3
- <%=h @parent.name %>
3
+ <%=h @parent_model.name %>
4
4
  </p>
5
5
 
6
- <% @parent.some_other_models.each do |some_other_model| %>
6
+ <% @parent_model.child_models.each do |child_model| %>
7
7
  <div class="child">
8
8
  <p>
9
- <b>SomeOtherModel Name:</b>
10
- <%=h some_other_model.name %>
9
+ <b>ChildModel Name:</b>
10
+ <%=h child_model.name %>
11
11
  </p>
12
12
  </div>
13
13
  <% end %>
14
14
 
15
- <% @parent.testies.each do |testy| %>
15
+ <% @parent_model.second_child_models.each do |second_child_model| %>
16
16
  <div class="child">
17
17
  <p>
18
- <b>Testy First name:</b>
19
- <%=h testy.first_name %>
18
+ <b>SecondChildModel First name:</b>
19
+ <%=h second_child_model.first_name %>
20
20
  </p>
21
21
  <p>
22
- <b>Testy Last name:</b>
23
- <%=h testy.last_name %>
22
+ <b>SecondChildModel Last name:</b>
23
+ <%=h second_child_model.last_name %>
24
24
  </p>
25
25
  <p>
26
- <b>Testy Address:</b>
27
- <%=h testy.address %>
26
+ <b>SecondChildModel Address:</b>
27
+ <%=h second_child_model.address %>
28
28
  </p>
29
29
  <p>
30
- <b>Testy Some flag:</b>
31
- <%=h testy.some_flag %>
30
+ <b>SecondChildModel Some flag:</b>
31
+ <%=h second_child_model.some_flag %>
32
32
  </p>
33
33
  </div>
34
34
  <% end %>
35
35
 
36
- <%= link_to 'Edit', edit_parent_path(@parent) %> |
37
- <%= link_to 'Back', parents_path %>
36
+ <%= link_to 'Edit', edit_parent_model_path(@parent_model) %> |
37
+ <%= link_to 'Back', parent_models_path %>