Sha256: 65f7752ff254300a228e6635a191bd1ad0e44105ce53fa0079484d0711a2311f
Contents?: true
Size: 1.14 KB
Versions: 7
Compression:
Stored size: 1.14 KB
Contents
module IshManager class ApplicationController < ActionController::Base # protect_from_forgery :with => :exception, :prepend => true before_action :set_current_ability check_authorization def home authorize! :home, IshManager::Ability render 'home' end private def set_current_ability @current_ability ||= ::IshManager::Ability.new( current_user ) end def set_lists @sites_list = Site.all.list @cities_list = City.all.list @venues_list = Venue.all.list @reports_list = Report.all.list @galleries_list = Gallery.all.list @videos_list = Video.all.list @user_profiles_list = IshModels::UserProfile.all.list @tags_list = Tag.list end rescue_from ::CanCan::AccessDenied, :with => :access_denied private def access_denied exception store_location_for :user, request.path redirect_to user_signed_in? ? root_path : Rails.application.routes.url_helpers.new_user_session_path, :alert => exception.message end def pp_errors err err end def puts! a, b='' puts "+++ +++ #{b}" puts a.inspect end end end
Version data entries
7 entries across 7 versions & 1 rubygems