Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

document :hidden_field_id option for fields_for

  • Loading branch information...
commit 47b4ed90f57380786340f39de0c0952bf5860e01 1 parent a1c7eae
@senny senny authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 actionpack/lib/action_view/helpers/form_helper.rb
View
5 actionpack/lib/action_view/helpers/form_helper.rb
@@ -702,6 +702,11 @@ def apply_form_for_options!(record, object, options) #:nodoc:
# <% end %>
# ...
# <% end %>
+ #
+ # Note that fields_for will automatically generate a hidden field
+ # to store the ID of the record. There are circumstances where this
+ # hidden field is not needed and you can pass <tt>hidden_field_id: false</tt>
+ # to prevent fields_for from rendering it automatically.
def fields_for(record_name, record_object = nil, options = {}, &block)
builder = instantiate_builder(record_name, record_object, options)
output = capture(builder, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.