From b95d6e84b00bd926b1118f6a820eca7a870b8c35 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 14 Aug 2010 02:13:00 -0300 Subject: Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) --- railties/guides/source/nested_model_forms.textile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'railties/guides/source/nested_model_forms.textile') diff --git a/railties/guides/source/nested_model_forms.textile b/railties/guides/source/nested_model_forms.textile index 39b0c32f24..1d44da4df1 100644 --- a/railties/guides/source/nested_model_forms.textile +++ b/railties/guides/source/nested_model_forms.textile @@ -63,7 +63,7 @@ class Person def address Address.new end - + def address_attributes=(attributes) # ... end @@ -77,7 +77,7 @@ class Person def projects [Project.new, Project.new] end - + def projects_attributes=(attributes) # ... end @@ -101,7 +101,7 @@ class PeopleController < ActionController:Base @person.built_address 2.times { @person.projects.build } end - + def create @person = Person.new(params[:person]) if @person.save @@ -142,7 +142,7 @@ Now add a nested form for the +address+ association: <%= form_for @person do |f| %> <%= f.text_field :name %> - + <%= f.fields_for :address do |af| %> <%= f.text_field :street %> <% end %> @@ -154,7 +154,7 @@ This generates:
- +
@@ -183,7 +183,7 @@ The form code for an association collection is pretty similar to that of a singl <%= form_for @person do |f| %> <%= f.text_field :name %> - + <%= f.fields_for :projects do |pf| %> <%= f.text_field :name %> <% end %> @@ -195,7 +195,7 @@ Which generates:
- +
-- cgit v1.2.3