Created
July 17, 2014 14:24
-
-
Save kvzb/a3f41d130cd0c89d01fd to your computer and use it in GitHub Desktop.
In Ruby 2.1, methods return a symbol representing the method name. You can do cool stuff with it.
This file contains 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 | |
helper_method def current_user | |
@current_user ||= User.find(token: params[:token]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment