Permalink
Browse files

We don't need delegating polymorphic_url and polymorphic_path anymore

  • Loading branch information...
drogus committed Jul 24, 2010
1 parent a132229 commit 4cd6f7752658f0ec13d082fa2ee2a6f766410645
Showing with 6 additions and 10 deletions.
  1. +6 −10 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -264,23 +264,19 @@ def install_helpers(destinations = [ActionController::Base, ActionView::Base], r
class RoutesProxy
include ActionDispatch::Routing::UrlFor
- %w(url_options polymorphic_url polymorphic_path).each do |method|
- self.class_eval <<-RUBY, __FILE__, __LINE__ +1
- def #{method}(*args)
- scope.send(:_with_routes, routes) do
- scope.#{method}(*args)
- end
- end
- RUBY
- end
-
attr_accessor :scope, :routes
alias :_routes :routes
def initialize(routes, scope)
@routes, @scope = routes, scope
end
+ def url_options
+ scope.send(:_with_routes, routes) do
+ scope.url_options
+ end
+ end
+
def method_missing(method, *args)
if routes.url_helpers.respond_to?(method)
self.class.class_eval <<-RUBY, __FILE__, __LINE__ + 1

0 comments on commit 4cd6f77

Please sign in to comment.