Skip to content

Instantly share code, notes, and snippets.

@matthuhiggins
Created November 9, 2010 17:05
Show Gist options
  • Save matthuhiggins/669396 to your computer and use it in GitHub Desktop.
Save matthuhiggins/669396 to your computer and use it in GitHub Desktop.
matter of style
class ProfileController < ActionController::Base
private
def current_user
@current_user ||= User.find_by_username(session[:username]) if session[:username]
end
helper_method :current_user
end
class ProfileController < ActionController::Base
before_filter :set_current_user
private
def set_current_user
@current_user = User.find_by_username(session[:username]) if session[:username]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment