Sha256: e7e2b4dbe8814c973d7e7fcce69eae47194d507e527f4dacdde25332e36e4004

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 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
  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.3.1 dummy/app/controllers/application_controller.rb
dailycred-0.3.0 dummy/app/controllers/application_controller.rb