Skip to content

Instantly share code, notes, and snippets.

@piersadrian
Last active December 25, 2015 07:18
Show Gist options
  • Save piersadrian/6937864 to your computer and use it in GitHub Desktop.
Save piersadrian/6937864 to your computer and use it in GitHub Desktop.
module SessionsHelper
...
def authenticate!
raise ActionController::RoutingError.new("Unauthorized") unless signed_in?
end
end
class SomeController
before_action :authenticate!
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment