From 82f33dce9c6229bee35af35a9aa3bc9c144737f3 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 14 May 2011 22:18:36 -0300 Subject: Use record_name to make fields for methods more consistent --- actionpack/lib/action_view/helpers/form_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index cc8b61228f..07e2c8d341 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -584,8 +584,8 @@ module ActionView # <% end %> # ... # <% end %> - def fields_for(record, record_object = nil, options = {}, &block) - builder = instantiate_builder(record, record_object, options, &block) + def fields_for(record_name, record_object = nil, options = {}, &block) + builder = instantiate_builder(record_name, record_object, options, &block) output = capture(builder, &block) output.concat builder.hidden_field(:id) if output && options[:hidden_field_id] && !builder.emitted_hidden_id? output @@ -898,13 +898,13 @@ module ActionView private - def instantiate_builder(record, record_object, options, &block) - case record + def instantiate_builder(record_name, record_object, options, &block) + case record_name when String, Symbol object = record_object - object_name = record + object_name = record_name else - object = record + object = record_name object_name = ActiveModel::Naming.param_key(object) end -- cgit v1.2.3