diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2011-05-14 22:18:36 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2011-05-14 22:18:36 -0300 |
commit | 82f33dce9c6229bee35af35a9aa3bc9c144737f3 (patch) | |
tree | 8a52fe4108479cff46bb08e31dd558aac1362f8f /actionpack | |
parent | f0479cbbd52961c75906022003d4f03aa39556e0 (diff) | |
download | rails-82f33dce9c6229bee35af35a9aa3bc9c144737f3.tar.gz rails-82f33dce9c6229bee35af35a9aa3bc9c144737f3.tar.bz2 rails-82f33dce9c6229bee35af35a9aa3bc9c144737f3.zip |
Use record_name to make fields for methods more consistent
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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 |