Module: ExceptionHunter::ApplicationHelper

Includes:
Pagy::Frontend
Defined in:
app/helpers/exception_hunter/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#application_nameObject



5
6
7
8
9
10
11
# File 'app/helpers/exception_hunter/application_helper.rb', line 5

def application_name
  if defined? Rails.application.class.module_parent_name
    Rails.application.class.module_parent_name
  else
    Rails.application.class.parent_name
  end
end

#display_action_button(title, error) ⇒ Object



13
14
15
16
17
# File 'app/helpers/exception_hunter/application_helper.rb', line 13

def display_action_button(title, error)
  button_to(title.to_s, route_for_button(title, error),
            class: "button button-outline #{title}-button",
            data: { confirm: "Are you sure you want to #{title} this error?" }).to_s
end

#route_for_button(title, error) ⇒ Object



19
20
21
22
23
24
25
# File 'app/helpers/exception_hunter/application_helper.rb', line 19

def route_for_button(title, error)
  if title.eql?('ignore')
    ignored_errors_path(error_group: { id: error.id })
  else
    resolved_errors_path(error_group: { id: error.id })
  end
end