Sha256: fbd4632a0713cd59ffa9ddd3b18b3913ce2a627138cf14196c3fb192ffc78211

Contents?: true

Size: 415 Bytes

Versions: 4

Compression:

Stored size: 415 Bytes

Contents

module Hatchy
  class ApplicationController < ActionController::Base
    include Pundit
    before_filter :authenticate_user!
    protect_from_forgery

    rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized

    private
    def user_not_authorized
      flash[:error] = "You are not authorized to perform this action."
      redirect_to request.headers["Referer"] || root_path
    end    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hatchy-0.0.8.pre app/controllers/hatchy/application_controller.rb
hatchy-0.0.7.pre app/controllers/hatchy/application_controller.rb
hatchy-0.0.6.pre app/controllers/hatchy/application_controller.rb
hatchy-0.0.5.pre app/controllers/hatchy/application_controller.rb