diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-09-26 00:54:44 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-26 02:13:48 +0800 |
commit | ecc13f7c18d6255dd6cc13c76dbc6fd1c4c317b5 (patch) | |
tree | 5e5750fd34c8fd42ff1bf56000e59507f7702fc4 /actionpack/lib | |
parent | 00e7633555451eb617d68da6e53e4839dcc759d0 (diff) | |
download | rails-ecc13f7c18d6255dd6cc13c76dbc6fd1c4c317b5.tar.gz rails-ecc13f7c18d6255dd6cc13c76dbc6fd1c4c317b5.tar.bz2 rails-ecc13f7c18d6255dd6cc13c76dbc6fd1c4c317b5.zip |
We don't need to check if the format exists to generate the url, it already does it internally
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 8abf0bfa59..3ebc6601e5 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -324,14 +324,13 @@ module ActionView as = options[:as] action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :put] : [:new, :post] - html_options = { :class => as ? "#{as}_#{action}" : dom_class(object, action), - :id => as ? "#{as}_#{action}" : dom_id(object, action), - :method => method } - options[:html].reverse_merge!(html_options) - - options[:url] ||= options[:format] ? - polymorphic_path(object_or_array, :format => options.delete(:format)) : - polymorphic_path(object_or_array) + options[:html].reverse_merge!( + :class => as ? "#{as}_#{action}" : dom_class(object, action), + :id => as ? "#{as}_#{action}" : dom_id(object, action), + :method => method + ) + + options[:url] ||= polymorphic_path(object_or_array, :format => options.delete(:format)) end private :apply_form_for_options! |