Permalink
Browse files

😢🔫 use an empty hash for magical speed.

For some reason, if the hash is empty, we choose "optimized" routes.  I
am not sure how or why optimized routes differ from regular routes.
But, if we make sure the hash is empty, we get a nice speed improvement.
  • Loading branch information...
tenderlove committed May 12, 2014
1 parent 3d9bd2a commit 547881594b32a447178c3e90c88e1b6437ee51e0
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionview/lib/action_view/helpers/form_helper.rb
@@ -449,7 +449,11 @@ def apply_form_for_options!(record, object, options) #:nodoc:
method: method
)
- options[:url] ||= polymorphic_path(record, format: options.delete(:format))
+ options[:url] ||= if options.key?(:format)
+ polymorphic_path(record, format: options.delete(:format))
+ else
+ polymorphic_path(record, {})
+ end
end
private :apply_form_for_options!

0 comments on commit 5478815

Please sign in to comment.