From 75bfe647834bc9e46d6400c21cd8ffeb80cffd89 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 May 2014 17:42:34 -0700 Subject: golf down a bit --- actionpack/lib/action_dispatch/routing/mapper.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index ab2df76856..132bf4473e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -239,8 +239,7 @@ module ActionDispatch def default_controller_and_action return {} if to.respond_to? :call - controller, action = get_controller_and_action( - default_controller, + controller, action = get_controller_and_action(default_controller, default_action, to, @scope[:module] @@ -278,12 +277,9 @@ module ActionDispatch def get_controller_and_action(controller, action, to, modyoule) case to - when Symbol - action = to.to_s - when /#/ - controller, action = to.split('#') - when String - controller = to + when Symbol then action = to.to_s + when /#/ then controller, action = to.split('#') + when String then controller = to end if modyoule && !controller.is_a?(Regexp) -- cgit v1.2.3