From 47b4ed90f57380786340f39de0c0952bf5860e01 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sat, 24 Nov 2012 17:35:29 +0100 Subject: document :hidden_field_id option for fields_for --- actionpack/lib/action_view/helpers/form_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack') 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 hidden_field_id: false + # 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) -- cgit v1.2.3