Permalink
Browse files

Merge pull request #8306 from senny/documentation_for_hidden_field_id

Document :hidden_field_id option for fields_for [ci skip]
  • Loading branch information...
carlosantoniodasilva committed Nov 24, 2012
2 parents d23c761 + 47b4ed9 commit e95b9d6c68b1e0bba3840d18fc0aa94ccf88776d
Showing with 5 additions and 0 deletions.
  1. +5 −0 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)

0 comments on commit e95b9d6

Please sign in to comment.