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
1 changed files with 1 additions and 1 deletions

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