Created
April 9, 2014 06:55
-
-
Save cutalion/10233536 to your computer and use it in GitHub Desktop.
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
# How to not use 'before_action :authorize_user!' in controllers | |
devise_for :users | |
root to: "home#index" | |
# this route for signed in users and guests | |
resources :games, only: [:show] | |
# create routes with redirect to sign_in for guests | |
authenticate(:user) do | |
resources :games, only: [:new] | |
resources :participations, only: [:create] | |
end | |
# these routes are for signed in user | |
authenticated(:user) do | |
resources :games | |
resources :participations, only: [:create, :destroy] | |
resources :weights, only: [:new, :create, :index] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment