diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d4957c86..93a9dc42 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,11 @@ class ApplicationController < ActionController::Base include Pagy::Backend - rescue_from ActionController::RoutingError, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: ->(exception) { render_error 404, exception } + rescue_from ActionController::UnknownFormat, + ActionController::RoutingError, + ::AbstractController::ActionNotFound, + ActiveRecord::RecordNotFound, + with: ->(exception) { render_error 404, exception } protect_from_forgery with: :exception before_action :set_paper_trail_whodunnit @@ -44,7 +48,7 @@ def access_denied_for_admin_resource(exception) def render_error(_status, exception) # raise exception if Rails.env.development? - render 'shared/not_found' + render 'shared/not_found', formats: [:html], status: 404 end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9ced761f..0952a6af 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,6 +1,10 @@ module ApplicationHelper include Pagy::Frontend + def is_current_page?(controller:, action: nil) + controller_name == controller && (action.nil? || action_name == action) + end + def set_page_title(title, data_options = {}) content_for :title, title options = data_options.map do |key, value| diff --git a/app/views/landing/_footer.html.erb b/app/views/landing/_footer.html.erb index e2762847..46c73bab 100644 --- a/app/views/landing/_footer.html.erb +++ b/app/views/landing/_footer.html.erb @@ -1,4 +1,4 @@ -