Browse files

Tweak exception message to avoid giving potentially misleading sugges…

…tions
  • Loading branch information...
1 parent a2b7c0e commit 1a25ebf884206df34b30a0bac8345d75fbc6d13c @trevorturk trevorturk committed Mar 20, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/routing/route_set.rb
View
5 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -405,8 +405,9 @@ def add_route(app, conditions = {}, requirements = {}, defaults = {}, name = nil
if name && named_routes[name]
raise ArgumentError, "Invalid route name, already in use: '#{name}' \n" \
- "This conflict might arise if your routes contain `resources :#{name.pluralize}`. " \
- "If so, you can restrict the routes created with `resources` as explained here: \n" \
+ "You may have defined two routes with the same name using the `:as` option, or "
+ "you may be overriding a route already defined by a resource with the same naming. " \
+ "For the latter, you can restrict the routes created with `resources` as explained here: \n" \
"http://guides.rubyonrails.org/routing.html#restricting-the-routes-created"
end

0 comments on commit 1a25ebf

Please sign in to comment.