diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 17:42:34 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 17:42:34 -0700 |
commit | 75bfe647834bc9e46d6400c21cd8ffeb80cffd89 (patch) | |
tree | b613d5c769dbe07313734af0d933802270035a13 | |
parent | 3d0dc81a078a738338a49124b7c6636a16319f83 (diff) | |
download | rails-75bfe647834bc9e46d6400c21cd8ffeb80cffd89.tar.gz rails-75bfe647834bc9e46d6400c21cd8ffeb80cffd89.tar.bz2 rails-75bfe647834bc9e46d6400c21cd8ffeb80cffd89.zip |
golf down a bit
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 4 insertions, 8 deletions
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) |