Skip to content

Instantly share code, notes, and snippets.

@arjan0307
Created February 15, 2013 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjan0307/4959630 to your computer and use it in GitHub Desktop.
Save arjan0307/4959630 to your computer and use it in GitHub Desktop.
check if we're in game.
class ApplicationController < ActionController::Base
protect_from_forgery
layout :ingame, only: :ingame?
before_filter :authenticate_user!, only: :ingame?
check_authorization if: :ingame?
def ingame?
is_a?(IngameController) || (is_a?(RegistrationsController) && ['edit', 'update'].include?(action_name))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment