Last active
August 25, 2020 20:57
-
-
Save lin/90e6ae0aa80927c2120f to your computer and use it in GitHub Desktop.
Rails Basic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| devise_for :people, skip: [:sessions, :passwords, :confirmations, :registrations] | |
| as :person do | |
| # session handling | |
| get '/login' => 'devise/sessions#new', as: 'new_person_session' | |
| post '/login' => 'devise/sessions#create', as: 'person_session' | |
| delete '/logout' => 'devise/sessions#destroy', as: 'destroy_person_session' | |
| # joining | |
| get '/join' => 'devise/registrations#new', as: 'new_person_registration' | |
| post '/join' => 'devise/registrations#create', as: 'person_registration' | |
| scope '/account' do | |
| # password reset | |
| get '/reset-password' => 'devise/passwords#new', as: 'new_person_password' | |
| put '/reset-password' => 'devise/passwords#update', as: 'person_password' | |
| post '/reset-password' => 'devise/passwords#create' | |
| get '/reset-password/change' => 'devise/passwords#edit', as: 'edit_person_password' | |
| # confirmation | |
| get '/confirm' => 'devise/confirmations#show', as: 'person_confirmation' | |
| post '/confirm' => 'devise/confirmations#create' | |
| get '/confirm/resend' => 'devise/confirmations#new', as: 'new_person_confirmation' | |
| # settings & cancellation | |
| get '/cancel' => 'devise/registrations#cancel', as: 'cancel_person_registration' | |
| get '/settings' => 'devise/registrations#edit', as: 'edit_person_registration' | |
| put '/settings' => 'devise/registrations#update' | |
| # account deletion | |
| delete '' => 'devise/registrations#destroy' | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| helper_method :current_user, :logged_in? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment