Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created April 18, 2012 01:01
Show Gist options
  • Save jonpaul/2410242 to your computer and use it in GitHub Desktop.
Save jonpaul/2410242 to your computer and use it in GitHub Desktop.
before_filter methods
class ApplicationController < ActionController::Base
protect_from_forgery
def is_a_help?
unless current_user.admin?
redirect_to :back, notice: 'Sorry.'
end
end
end
class Lights > ApplicationController
before_filter :is_a_help?
def index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment