diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 13:57:16 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 13:57:16 +0000 |
commit | 00fe726a764c3a935351999022d3eac5cc89aac5 (patch) | |
tree | 76f63c3f44cf782e83f3864dcf79ca5120f6f0b7 /actionpack/lib | |
parent | 87b55f59ddf85dd31ed0ab5916e80f8368934926 (diff) | |
download | rails-00fe726a764c3a935351999022d3eac5cc89aac5.tar.gz rails-00fe726a764c3a935351999022d3eac5cc89aac5.tar.bz2 rails-00fe726a764c3a935351999022d3eac5cc89aac5.zip |
Updated docs on auto-indexing #765 [Astinus]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index e4b90e42f2..32233d26d6 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -45,6 +45,14 @@ module ActionView # <input type="submit" value="Save"> # </form> # + # If the object name contains square brackets the id for the object will be inserted. Example: + # + # <%= textfield "person[]", "name" %> + # + # ...becomes: + # + # <input type="text" id="person_<%= @person.id %>_name" name="person[<%= @person.id %>][name]" value="<%= @person.name %>" /> + # # If the helper is being used to generate a repetitive sequence of similar form elements, for example in a partial # used by render_collection_of_partials, the "index" option may come in handy. Example: # |