aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-01-25 10:19:37 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2013-01-30 10:24:57 -0800
commit06f2ec4530ccf28a3da67b037b541d34ecef4658 (patch)
tree393a32447ae40545d7c16a4ce8e0749cd4942816 /actionpack/lib/action_dispatch/routing/route_set.rb
parent2cdbe2270d2072249cd1622d843645e2813535bd (diff)
downloadrails-06f2ec4530ccf28a3da67b037b541d34ecef4658.tar.gz
rails-06f2ec4530ccf28a3da67b037b541d34ecef4658.tar.bz2
rails-06f2ec4530ccf28a3da67b037b541d34ecef4658.zip
pull stuff out of the caller and hide in the instance
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 4864475172..6c4315213c 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -203,9 +203,9 @@ module ActionDispatch
t.url_for(handle_positional_args(t, args, @options, @segment_keys))
end
- def url_if(t, path)
+ def url_if(t, args)
@options.merge!(t.url_options) if t.respond_to?(:url_options)
- @options[:path] = path
+ @options[:path] = eval("\"#{optimized_helper}\"")
ActionDispatch::Http::URL.url_for(@options)
end
@@ -242,7 +242,6 @@ module ActionDispatch
helper = UrlHelper.create(route, options.dup)
ohelp = helper.optimize_helper?
- ohelper = helper.optimized_helper
arg_size = route.required_parts.size
@module.module_eval do
@@ -250,7 +249,7 @@ module ActionDispatch
#helper.call t, args
if ohelp && args.size == arg_size && !args.last.is_a?(Hash) && optimize_routes_generation?
- helper.url_if(self, eval("\"#{ohelper}\""))
+ helper.url_if(self, args)
else
helper.url_else(self, args)
end