From b8689c77a49df98802ec04ca60c9602fa092385c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 27 Jun 2005 15:17:59 +0000 Subject: Don't ignore :controller for urls made inside a controller module #1526 [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1542 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 7e71a6057b..27f651da51 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -360,8 +360,10 @@ module ActionController def generate(options, request_or_recall_hash = {}) recall = request_or_recall_hash.is_a?(Hash) ? request_or_recall_hash : request_or_recall_hash.symbolized_path_parameters - if ((rc_c = recall[:controller]) && rc_c.include?(?/)) || ((c = options[:controller]) && c.include?(?/)) - options[:controller] = Routing.controller_relative_to(c, rc_c) + controller = options[:controller] + recall_controller = recall[:controller] + if (recall_controller && recall_controller.include?(?/)) || (controller && controller.include?(?/)) + options[:controller] = Routing.controller_relative_to(controller, recall_controller) end options = recall.dup if options.empty? # XXX move to url_rewriter? Routing.treat_hash(options) # XXX Move inwards (to generated code) or inline? -- cgit v1.2.3