Sha256: 2bbf489f717a27a9a90d40fbb4bb1e6408a58493b1935592749fca4b77853a42

Contents?: true

Size: 653 Bytes

Versions: 11

Compression:

Stored size: 653 Bytes

Contents

module ExceptionNotificationServer
  class ApplicationController < ActionController::Base
    before_action :redirect_to_root, unless: :admin?

    add_flash_types :error, :success, :info

    def redirect_to_root
      respond_to do |format|
        format.js { render js: "window.location = '#{Rails.application.routes.url_helpers.root_url}';" }
        format.all { redirect_to Rails.application.routes.url_helpers.root_url }
      end
    end

    protected

    def admin?
      ExceptionNotificationServer.configuration.access_callback.present? ? ExceptionNotificationServer.configuration.access_callback.try(:call, self) : true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
exception_notification_server-0.0.11 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.10 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.9 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.8 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.7 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.6 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.5 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.4 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.3 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.2 app/controllers/exception_notification_server/application_controller.rb
exception_notification_server-0.0.1 app/controllers/exception_notification_server/application_controller.rb