aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFrederick Cheung <frederick.cheung@gmail.com>2009-01-25 12:41:11 +0000
committerFrederick Cheung <frederick.cheung@gmail.com>2009-01-25 12:41:11 +0000
commit098dc68f5c627bfc2b8705762736096a2bae3b38 (patch)
treecb95bd01553cfc4469c2da96e51344b925ed1b02 /railties
parent279ec8116c34dc6aa26e4e54c8d6f2eb1e03baf5 (diff)
downloadrails-098dc68f5c627bfc2b8705762736096a2bae3b38.tar.gz
rails-098dc68f5c627bfc2b8705762736096a2bae3b38.tar.bz2
rails-098dc68f5c627bfc2b8705762736096a2bae3b38.zip
don't use short form of form_for before it's been introduced
Diffstat (limited to 'railties')
-rw-r--r--railties/doc/guides/source/form_helpers.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/doc/guides/source/form_helpers.txt b/railties/doc/guides/source/form_helpers.txt
index 94a1d0a3ed..a0c6fecdcc 100644
--- a/railties/doc/guides/source/form_helpers.txt
+++ b/railties/doc/guides/source/form_helpers.txt
@@ -263,9 +263,9 @@ The name passed to `form_for` controls the key used in `params` to access the fo
The helper methods called on the form builder are identical to the model object helpers except that it is not necessary to specify which object is being edited since this is already managed by the form builder.
-You can create a similar binding without actually creating `<form>` tags with the `fields_for` helper. This is useful for editing additional model objects with the same form. For example if you had a Person model with an associated ContactDetail model you could create a form for editing both like so:
+You can create a similar binding without actually creating `<form>` tags with the `fields_for` helper. This is useful for editing additional model objects with the same form. For example if you had a Person model with an associated ContactDetail model you could create a form for creating both like so:
-------------
-<% form_for @person do |person_form| %>
+<% form_for :person, @person, :url => { :action => "create" } do |person_form| %>
<%= person_form.text_field :name %>
<% fields_for @person.contact_detail do |contact_details_form| %>
<%= contact_details_form.text_field :phone_number %>
@@ -276,7 +276,7 @@ You can create a similar binding without actually creating `<form>` tags with t
which produces the following output:
-------------
-<form action="/people/1" class="edit_person" id="edit_person_1" method="post">
+<form action="/people/create" class="create_person" id="create_person" method="post">
<input id="person_name" name="person[name]" size="30" type="text" />
<input id="contact_detail_phone_number" name="contact_detail[phone_number]" size="30" type="text" />
</form>