Skip to content

Instantly share code, notes, and snippets.

@anthonygharvey
Created August 4, 2019 15:31
Show Gist options
  • Save anthonygharvey/ae3a0ab5c9fdde7e82ce56052499cc85 to your computer and use it in GitHub Desktop.
Save anthonygharvey/ae3a0ab5c9fdde7e82ce56052499cc85 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# other controller actions
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
helper_method :current_user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment