1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Additional explanation to overriding resource routes

This commit is contained in:
Kyler Moore 2020-10-03 11:44:16 -04:00 committed by GitHub
parent 5e573579b5
commit 2b8cb84e16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -640,7 +640,7 @@ get 'exit', to: 'sessions#destroy', as: :logout
This will create `logout_path` and `logout_url` as named route helpers in your application. Calling `logout_path` will return `/exit`
You can also use this to override routing methods defined by resources, like this:
You can also use this to override routing methods defined by resources by placing custom routes before the resource is defined, like this:
```ruby
get ':username', to: 'users#show', as: :user