1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

😢🔫 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.
This commit is contained in:
Aaron Patterson 2014-05-12 16:16:06 -07:00
parent 3d9bd2ac94
commit 547881594b

View file

@ -449,7 +449,11 @@ module ActionView
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!