From 0944a1fa172976e05fb7acbb0a8664509408d92e Mon Sep 17 00:00:00 2001 From: "Jon R. Humphrey" Date: Fri, 8 Mar 2024 15:11:32 +0000 Subject: [PATCH 1/2] fix: resolves missing template error now returns the error status as human readable plain string which does not require a specific template --- app/controllers/application_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b1a3f70..21c3b27 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -69,9 +69,8 @@ def render_error(status) respond_to do |format| format.html { render_html_error_page(status) } - format.all do - render nothing: true, status: status - end + # Anything else returns the status as human readable plain string + format.all { render plain: Rack::Utils::HTTP_STATUS_CODES[status].to_s, status: status } end end From 3f6cbe4c3e1ec73d83b26dc912dff16789f87269 Mon Sep 17 00:00:00 2001 From: "Jon R. Humphrey" Date: Fri, 8 Mar 2024 15:12:51 +0000 Subject: [PATCH 2/2] style: Unnecessary disabling of `Metrics/PerceivedComplexity` --- app/controllers/search_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index e4c03cb..ec0ce04 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -8,7 +8,7 @@ def index create end - # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity + # rubocop:disable Metrics/MethodLength def create @preferences = UserPreferences.new(params)