aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-12 16:16:06 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 16:16:06 -0700
commit547881594b32a447178c3e90c88e1b6437ee51e0 (patch)
tree5187c953e7d080a2701efd1d42cbf6c757f5ba72 /actionview/lib/action_view/helpers/form_helper.rb
parent3d9bd2ac9482eabf4ee0ed286952ccd19207e851 (diff)
downloadrails-547881594b32a447178c3e90c88e1b6437ee51e0.tar.gz
rails-547881594b32a447178c3e90c88e1b6437ee51e0.tar.bz2
rails-547881594b32a447178c3e90c88e1b6437ee51e0.zip
:cry::gun: 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.
Diffstat (limited to 'actionview/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb
index 22bfd87d85..180c4a62bf 100644
--- a/actionview/lib/action_view/helpers/form_helper.rb
+++ b/actionview/lib/action_view/helpers/form_helper.rb
@@ -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!