Last active
August 29, 2015 14:19
-
-
Save chrisyeung1121/e76176a5ff78e984a3a9 to your computer and use it in GitHub Desktop.
Scoping controllers in rails routes
This file contains 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
as :user do | |
# Sessions | |
get '/login' => 'users/sessions#new', as: :new_user_session | |
# Registration | |
controller 'users/registrations' do | |
get '/signup', action: :new, as: :new_user_registration | |
end | |
end | |
# can also do sth like this: | |
match '/auth/:provider/callback', to: 'sessions#create', via: [:get, :post] | |
## the ways we write in #sessions and #registrations are inter-changeable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment