Class: ExceptionHunter::ErrorsController

Inherits:
ApplicationController show all
Includes:
Pagy::Backend
Defined in:
app/controllers/exception_hunter/errors_controller.rb

Instance Method Summary collapse

Methods included from Authorization

#authenticate_admin_user_class, #redirect_to_login, #underscored_admin_user_class

Instance Method Details

#destroyObject



18
19
20
21
22
# File 'app/controllers/exception_hunter/errors_controller.rb', line 18

def destroy
  ErrorReaper.purge

  redirect_back fallback_location: errors_path, notice: 'Errors purged successfully'
end

#indexObject



7
8
9
10
11
# File 'app/controllers/exception_hunter/errors_controller.rb', line 7

def index
  @dashboard = DashboardPresenter.new(current_tab)
  shown_errors = errors_for_tab(@dashboard).order(updated_at: :desc).distinct
  @errors = ErrorGroupPresenter.wrap_collection(shown_errors)
end

#showObject



13
14
15
16
# File 'app/controllers/exception_hunter/errors_controller.rb', line 13

def show
  @pagy, errors = pagy(most_recent_errors, items: 1)
  @error = ErrorPresenter.new(errors.first!)
end