Sha256: 444aad40d159b00d1fe6dfe869b3c6ef5a193a4b6b753a2657dbb5c3e9a0638e

Contents?: true

Size: 375 Bytes

Versions: 8

Compression:

Stored size: 375 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery

  protected

    def current_user
      @current_user ||= User.find_by_id(session[:user_id])
    end

    def signed_in?
      !!current_user
    end

    helper_method :current_user, :signed_in?

    def current_user=(user)
      @current_user = user
      session[:user_id] = user.id
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
echo_base-0.2.1 lib/templates/app/controllers/application_controller.rb
echo_base-0.1.3 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.1.2 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.1.1 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.1.0 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.0.4 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.0.3 lib/generators/echo_base/templates/app/controllers/application_controller.rb
echo_base-0.0.2 lib/generators/echo_base/templates/app/controllers/application_controller.rb