Class: RubyCms::Admin::VisitorErrorsController
Constant Summary
RubyCms::AdminPagination::DEFAULT_MAX_PER_PAGE, RubyCms::AdminPagination::DEFAULT_MIN_PER_PAGE
Instance Method Summary
collapse
#turbo_frame_id, #turbo_frame_request?, #turbo_redirect_to, #turbo_render_index, #turbo_stream_replace_table, #turbo_stream_request?, #turbo_stream_update_table
#paginate_collection, #set_pagination_vars
Instance Method Details
#bulk_delete ⇒ Object
32
33
34
35
36
37
|
# File 'app/controllers/ruby_cms/admin/visitor_errors_controller.rb', line 32
def bulk_delete
ids = Array(params[:item_ids]).filter_map(&:to_i)
count = RubyCms::VisitorError.where(id: ids).destroy_all.size
redirect_to ruby_cms_admin_visitor_errors_path,
notice: t("ruby_cms.admin.visitor_errors.bulk_deleted", count:)
end
|
#bulk_mark_as_resolved ⇒ Object
39
40
41
42
43
44
|
# File 'app/controllers/ruby_cms/admin/visitor_errors_controller.rb', line 39
def bulk_mark_as_resolved
ids = Array(params[:item_ids]).filter_map(&:to_i)
count = mark_visitor_errors_resolved(ids)
redirect_to ruby_cms_admin_visitor_errors_path,
notice: t("ruby_cms.admin.visitor_errors.bulk_resolved", count:)
end
|
#index ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'app/controllers/ruby_cms/admin/visitor_errors_controller.rb', line 15
def index
scope = RubyCms::VisitorError.recent
scope = scope.where(resolved: params[:resolved] == "true") if params[:resolved].present?
scope = apply_search_filter(scope)
scope = apply_error_type_filter(scope)
@visitor_errors = (scope)
render_index
end
|
#resolve ⇒ Object
26
27
28
29
30
|
# File 'app/controllers/ruby_cms/admin/visitor_errors_controller.rb', line 26
def resolve
@visitor_error.update!(resolved: true)
redirect_to ruby_cms_admin_visitor_errors_path,
notice: t("ruby_cms.admin.visitor_errors.resolved")
end
|
#show ⇒ Object
24
|
# File 'app/controllers/ruby_cms/admin/visitor_errors_controller.rb', line 24
def show; end
|