Skip to content

Instantly share code, notes, and snippets.

@dougc84
Created December 13, 2012 23:13
Show Gist options
  • Save dougc84/4281014 to your computer and use it in GitHub Desktop.
Save dougc84/4281014 to your computer and use it in GitHub Desktop.
before filter example
class HomeController < ApplicationController
layout 'login'
before_filter :actions_if_signed_in
def index
end
def blocked
end
def invalid
end
private
def actions_if_signed_in
if signed_in?
redirect_to dashboard_index_path
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment