diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-08 18:42:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-12 15:54:45 -0700 |
commit | cfdda38088c95194c3d8bb2fedb70bc06e8fe2e0 (patch) | |
tree | be5464d2026b8eff8e441126790469adbd87deda /actionview/lib/action_view | |
parent | 965664008001bb78f0369e3eb2a267991d7b6a84 (diff) | |
download | rails-cfdda38088c95194c3d8bb2fedb70bc06e8fe2e0.tar.gz rails-cfdda38088c95194c3d8bb2fedb70bc06e8fe2e0.tar.bz2 rails-cfdda38088c95194c3d8bb2fedb70bc06e8fe2e0.zip |
use the helper method builder to construct helper methods
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/routing_url_for.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionview/lib/action_view/routing_url_for.rb b/actionview/lib/action_view/routing_url_for.rb index 1eb5dd6343..881a123572 100644 --- a/actionview/lib/action_view/routing_url_for.rb +++ b/actionview/lib/action_view/routing_url_for.rb @@ -1,3 +1,5 @@ +require 'action_dispatch/routing/polymorphic_routes' + module ActionView module RoutingUrlFor @@ -83,12 +85,14 @@ module ActionView super({ :only_path => options[:host].nil? }.merge!(options.symbolize_keys)) when :back _back_url + when Symbol + ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder.path.handle_string_call self, options when Array polymorphic_path(options, options.extract_options!) when Class - polymorphic_path(options, {}) + ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder.path.handle_class_call self, options else - polymorphic_path(options, {}) + ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder.path.handle_model_call self, options end end |