Sha256: e2c4ed1a9117827a0ae1228cf2d2d272972739415a18d9a50b02cccc2fc654ac

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

class ApplicationController < ActionController::Base
  helper_method :current_user

  private

  # helper method for getting the current signed in user
  def current_user
    begin
      @current_user || User.find(session[:user_id]) if session[:user_id]
    rescue
      nil
    end
  end
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dailycred-0.2.0 dummy/app/controllers/application_controller.rb
dailycred-0.1.8 dummy/app/controllers/application_controller.rb