defined in rails/actionpack/lib/abstract_controller/helpers.rb
Declare a controller method as a helper. For example, the following
class ApplicationController < ActionController::Base
helper_method :current_user, :logged_in?
def current_user
@current_user ||= User.find_by_id(session[:user])
end
def logged_in?
current_user != nil
end
end
then in view
<% if logged_in? -%>Welcome, <%= current_user.name %><% end -%>
The helper
class method can take a series of helper module names, a block, or both.
###Parameters