From 62fd6d8c59b03d91c35ed0e9cf40a3f81de89dcc Mon Sep 17 00:00:00 2001 From: eparreno Date: Fri, 28 May 2010 16:46:12 +0200 Subject: add <%= to fields_for examples --- railties/guides/source/action_view_overview.textile | 2 +- railties/guides/source/getting_started.textile | 2 +- railties/guides/source/nested_model_forms.textile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index 43ebe87875..8b5eda0973 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -699,7 +699,7 @@ Creates a scope around a specific model object like form_for, but doesn‘t crea First name: <%= person_form.text_field :first_name %> Last name : <%= person_form.text_field :last_name %> - <% fields_for @person.permission do |permission_fields| %> + <%= fields_for @person.permission do |permission_fields| %> Admin? : <%= permission_fields.check_box :admin %> <% end %> <% end %> diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index fe623e969f..46e709d0f5 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -1342,7 +1342,7 @@ We also add a @post.tags.build at the top of this form, this is to make Now create the folder app/views/tags and make a file in there called _form.html.erb which contains the form for the tag: -<% form.fields_for :tags do |tag_form| %> +<%= form.fields_for :tags do |tag_form| %>
<%= tag_form.label :name, 'Tag:' %> <%= tag_form.text_field :name %> diff --git a/railties/guides/source/nested_model_forms.textile b/railties/guides/source/nested_model_forms.textile index 4a79902232..39b0c32f24 100644 --- a/railties/guides/source/nested_model_forms.textile +++ b/railties/guides/source/nested_model_forms.textile @@ -143,7 +143,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.fields_for :address do |af| %> <%= f.text_field :street %> <% end %> <% end %> @@ -184,7 +184,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.fields_for :projects do |pf| %> <%= f.text_field :name %> <% end %> <% end %> -- cgit v1.2.3