Sha256: ab5a7ecab127a49f7b23aa0f6772797716707b4fd313a9af36dbea920ac19d36
Contents?: true
Size: 895 Bytes
Versions: 49
Compression:
Stored size: 895 Bytes
Contents
module SocialStream module Controllers # Common methods added to ApplicationController module CancanDeviseIntegration extend ActiveSupport::Concern module InstanceMethods private # Catch some authorization errors: # # * Redirect to home when the user changes the session and the resource # is not accesible with the new representation # # * Redirect to login if the user is trying to access a protected resource # and she is not authenticated def rescue_from_access_denied(exception) if user_signed_in? if params[:s].present? && controller_name != 'home' redirect_to :home else raise exception end else redirect_to new_user_session_path end end end end end end
Version data entries
49 entries across 49 versions & 4 rubygems