Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated docs on auto-indexing #765 [Astinus]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 00fe726a764c3a935351999022d3eac5cc89aac5 1 parent 87b55f5
@dhh dhh authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/lib/action_view/helpers/form_helper.rb
View
8 actionpack/lib/action_view/helpers/form_helper.rb
@@ -45,6 +45,14 @@ module Helpers
# <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:
#
Please sign in to comment.
Something went wrong with that request. Please try again.