Sha256: bab0263401ff16c5541702cc3d3b1168ae0a68142e8813d1f37c86c860881c79
Contents?: true
Size: 993 Bytes
Versions: 2
Compression:
Stored size: 993 Bytes
Contents
require 'ostruct' module Faalis module Dashboard class ApplicationController < Faalis::ApplicationController include Faalis::Dashboard::DSL layout 'faalis/dashboard' before_action :authenticate_user! before_action :setup_sidebar before_action :setup_header rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized rescue_from ActiveRecord::RecordNotFound, with: :redirect_to_404 protected def setup_header @dashboard_section_title = t(controller_name.underscore) @dashboard_section_slug = t(action_name) end private def user_not_authorized flash[:alert] = t('faalis.not_authorized') redirect_to new_user_session_path end def redirect_to_404(e) respond_to do |f| f.html { redirect_to dashboard_not_found_url } f.js { render 'faalis/dashboard/not_found' } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
faalis-2.0.0.rc3 | app/controllers/faalis/dashboard/application_controller.rb |
faalis-2.0.0.rc2 | app/controllers/faalis/dashboard/application_controller.rb |