Class: RailsNexus::LoggedExceptionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_nexus/logged_exceptions_controller.rb

Constant Summary collapse

RANSACK_FILTERS =
%i[
  action_name_cont assigned_to_cont controller_name_cont created_at_gteq created_at_lteq
  exception_class_cont fingerprint_cont message_cont
  message_or_exception_class_or_controller_name_or_action_name_cont
  occurrence_count_gteq platform_eq priority_eq s
].freeze

Instance Method Summary collapse

Instance Method Details

#clearObject



72
73
74
75
76
77
78
79
80
81
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 72

def clear
  LoggedException.delete_all

  load_exception_index

  respond_to do |format|
    format.turbo_stream
    format.html { redirect_back fallback_location: rails_nexus_root_path }
  end
end

#destroyObject



46
47
48
49
50
51
52
53
54
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 46

def destroy
  @exception = LoggedException.find(params[:id])
  @exception.destroy!

  respond_to do |format|
    format.turbo_stream
    format.html { redirect_to logged_exceptions_path, status: :see_other }
  end
end

#destroy_allObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 56

def destroy_all
  exceptions = if params[:ids].present?
    LoggedException.where(id: params[:ids].to_s.split(","))
  else
    ransack_search.result(distinct: false)
  end
  exceptions.delete_all

  load_exception_index

  respond_to do |format|
    format.turbo_stream
    format.html { redirect_to logged_exceptions_path(params_filters) }
  end
end

#feedObject



27
28
29
30
31
32
33
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 27

def feed
  @exceptions = LoggedException.all

  respond_to do |format|
    format.rss { render layout: false }
  end
end

#indexObject



14
15
16
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 14

def index
  load_exception_index
end

#queryObject



18
19
20
21
22
23
24
25
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 18

def query
  load_exception_index

  respond_to do |format|
    format.turbo_stream
    format.html { render :query }
  end
end

#showObject



35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/rails_nexus/logged_exceptions_controller.rb', line 35

def show
  @exception = LoggedException.find(params[:id])
  load_nav_exceptions if RailsNexus.configuration.enable_navigation
  load_exception_tabs

  respond_to do |format|
    format.turbo_stream
    format.html
  end
end