Last active
August 29, 2015 14:02
-
-
Save sevenseacat/b68170f9c66c21365df4 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
| class PostsController < ApplicationController | |
| before_filter :authenticate_user, except: [:index, :show] | |
| def authenticate_user | |
| # I presume you have a current_user helper defined on your controller to get the authenticated user? | |
| raise ActionController::RoutingError, 'No valid user' unless current_user.present? | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment