Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweak exception message to avoid giving potentially misleading sugges…

…tions
  • Loading branch information...
commit 1a25ebf884206df34b30a0bac8345d75fbc6d13c 1 parent a2b7c0e
@trevorturk trevorturk authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.