Skip to content

Instantly share code, notes, and snippets.

@cutalion
Created April 9, 2014 06:55
Show Gist options
  • Save cutalion/10233536 to your computer and use it in GitHub Desktop.
Save cutalion/10233536 to your computer and use it in GitHub Desktop.
# 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