From be137b0ac389c5bed93df4b5a76e19549b8e1cfa Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 29 May 2014 16:08:56 -0700 Subject: no reason to make a Mapper object if the path is blank --- actionpack/lib/action_dispatch/routing/mapper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 879e8daa33..e4fd63cf0e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -91,7 +91,6 @@ module ActionDispatch private def normalize_path!(path, format) - raise ArgumentError, "path is required" if path.blank? path = Mapper.normalize_path(path) if format == true @@ -1500,6 +1499,8 @@ module ActionDispatch def add_route(action, options) # :nodoc: path = path_for_action(action, options.delete(:path)) + raise ArgumentError, "path is required" if path.blank? + action = action.to_s.dup if action =~ /^[\w\-\/]+$/ -- cgit v1.2.3