To use the same methods in both the controller and the views Add your method to application_controller.rb and make it helper methods .
for instance
class ApplicationController < ActionController::Base
helper :all
helper_method :current_user
def current_user
session[:user]
end
end
current_user