diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 73df6b693c..d9f7180f51 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -147,22 +147,23 @@ module ActionDispatch # Used by 'direct', 'resolve', and 'polymorphic' route helpers. def add_url_helper(name, defaults, &block) helper = CustomUrlHelper.new(name, defaults, &block) - _path_helper = :"#{name}_path" - _url_helper = :"#{name}_url" + path_name = :"#{name}_path" + url_name = :"#{name}_url" @path_helpers_module.module_eval do - define_method(:"#{_path_helper}") do |*args| + define_method(path_name) do |*args| helper.call(self, args, true) end end - @path_helpers << _path_helper @url_helpers_module.module_eval do - define_method(:"#{_url_helper}") do |*args| + define_method(url_name) do |*args| helper.call(self, args, false) end end - @url_helpers << _url_helper + + @path_helpers << path_name + @url_helpers << url_name self end |