aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-24 09:59:03 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-24 09:59:03 -0800
commite95b9d6c68b1e0bba3840d18fc0aa94ccf88776d (patch)
treeb2bb7a5a61df9dba6054f9704a50b382921ec3d7 /actionpack/lib
parentd23c761f5a514e10676aa3e0e1632946aaebcbf7 (diff)
parent47b4ed90f57380786340f39de0c0952bf5860e01 (diff)
downloadrails-e95b9d6c68b1e0bba3840d18fc0aa94ccf88776d.tar.gz
rails-e95b9d6c68b1e0bba3840d18fc0aa94ccf88776d.tar.bz2
rails-e95b9d6c68b1e0bba3840d18fc0aa94ccf88776d.zip
Merge pull request #8306 from senny/documentation_for_hidden_field_id
Document :hidden_field_id option for fields_for [ci skip]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 6abf1e1751..c79d30ea88 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -702,6 +702,11 @@ module ActionView
# <% 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)