Skip to content

Instantly share code, notes, and snippets.

@kvzb
Created July 17, 2014 14:24
Show Gist options
  • Save kvzb/a3f41d130cd0c89d01fd to your computer and use it in GitHub Desktop.
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.
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