Sha256: 485fec1df88e6277b4075c2c3ef68cd24ca7362f06460516d4a819ebb91dac06
Contents?: true
Size: 850 Bytes
Versions: 25
Compression:
Stored size: 850 Bytes
Contents
require 'spotlight' module Spotlight module Concerns # Inherit from the host app's ApplicationController # This will configure e.g. the layout used by the host module ApplicationController extend ActiveSupport::Concern include Spotlight::Controller included do layout 'spotlight/spotlight' helper Spotlight::ApplicationHelper rescue_from CanCan::AccessDenied do |exception| if current_exhibit && !can?(:read, current_exhibit) # Try to authenticate the user authenticate_user! # If that fails (and we end up back here), offer a 404 error instead fail ActionController::RoutingError, 'Not Found' else redirect_to main_app.root_url, alert: exception.message end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems