Permalink
Browse files

We don't need to check if the format exists to generate the url, it a…

…lready does it internally
  • Loading branch information...
1 parent 00e7633 commit ecc13f7c18d6255dd6cc13c76dbc6fd1c4c317b5 @carlosantoniodasilva carlosantoniodasilva committed with josevalim Sep 25, 2010
Showing with 7 additions and 8 deletions.
  1. +7 −8 actionpack/lib/action_view/helpers/form_helper.rb
View
15 actionpack/lib/action_view/helpers/form_helper.rb
@@ -324,14 +324,13 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
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!

0 comments on commit ecc13f7

Please sign in to comment.