diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 18:07:25 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 18:07:25 -0700 |
commit | 7e61a327ce0fdb4b98a76d318ca0b5ffee0be7de (patch) | |
tree | 1129361f2035876ae5cb03657349b757d7145026 | |
parent | d311922c82ace9de7ca588b47a54716835bdca2a (diff) | |
download | rails-7e61a327ce0fdb4b98a76d318ca0b5ffee0be7de.tar.gz rails-7e61a327ce0fdb4b98a76d318ca0b5ffee0be7de.tar.bz2 rails-7e61a327ce0fdb4b98a76d318ca0b5ffee0be7de.zip |
controllers with slash names are also not supported, so we can reuse the message
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 899f0fdc1b..0a1f6afd77 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -249,12 +249,8 @@ module ActionDispatch hash = check_part(:controller, controller, {}) do |part| translate_controller(part) { - if part =~ %r{\A/} - message = "controller name should not start with a slash" - else - message = "'#{part}' is not a supported controller name. This can lead to potential routing problems." - message << " See http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use" - end + message = "'#{part}' is not a supported controller name. This can lead to potential routing problems." + message << " See http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use" raise ArgumentError, message } |