From 7e61a327ce0fdb4b98a76d318ca0b5ffee0be7de Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 May 2014 18:07:25 -0700 Subject: controllers with slash names are also not supported, so we can reuse the message --- actionpack/lib/action_dispatch/routing/mapper.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing') 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 } -- cgit v1.2.3