Created
June 28, 2013 14:47
-
-
Save Heavyblade/5885237 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 ApplicationController < ActionController::Base | |
| protect_from_forgery | |
| def index | |
| @users = User.all | |
| render :template => "applications/index" | |
| end | |
| def current_user | |
| @current_user ||= warden.authenticate(:scope => :user) | |
| if @current_user && params[:app_name].present? | |
| return @current_user.application.try(:name) == params[:app_name] | |
| else | |
| session[:app_name] = params[:app_name] | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment