diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-10-26 04:48:19 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-10-26 04:48:19 +0000 |
commit | d5a93b6241b4df64f9656853d386eca96b6f6baf (patch) | |
tree | 4995d5453417b30762b3ed52db6780e37c030164 /actionpack/lib | |
parent | d761ac409586f887570cba88cf8d74f2c783223b (diff) | |
download | rails-d5a93b6241b4df64f9656853d386eca96b6f6baf.tar.gz rails-d5a93b6241b4df64f9656853d386eca96b6f6baf.tar.bz2 rails-d5a93b6241b4df64f9656853d386eca96b6f6baf.zip |
FormHelper's auto_index should use #to_param instead of #id_before_type_cast. Closes #9994 [mattly]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8033 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index cc81bad2b4..1a3c842271 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -415,10 +415,10 @@ module ActionView @template_object, @local_binding = template_object, local_binding @object = object if @object_name.sub!(/\[\]$/,"") - if object ||= @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}") and object.respond_to?(:id_before_type_cast) - @auto_index = object.id_before_type_cast + if object ||= @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}") and object.respond_to?(:to_param) + @auto_index = object.to_param else - raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to id_before_type_cast: #{object.inspect}" + raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}" end end end |