From dead9398c685d7cfaacc55c4a5e251958cd5feda Mon Sep 17 00:00:00 2001 From: Henrique Medeiros Date: Tue, 3 Oct 2023 12:09:37 -0300 Subject: [PATCH] Using redirect_back_or_to --- app/controllers/application_controller.rb | 2 +- app/views/shared/_navigation_bar.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 384b9d1..c540e2a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,7 +3,7 @@ class ApplicationController < ActionController::Base def execute_read_task system('rake read') - redirect_to root_path + redirect_back_or_to root_path flash[:notice] = "Read task executed!" end end diff --git a/app/views/shared/_navigation_bar.html.erb b/app/views/shared/_navigation_bar.html.erb index 9dc6baf..915c483 100644 --- a/app/views/shared/_navigation_bar.html.erb +++ b/app/views/shared/_navigation_bar.html.erb @@ -16,7 +16,7 @@
  • - <%= button_to "Execute 'Read' task", execute_read_task_path, class: "inline-block border rounded py-1 px-3", method: :post %> + <%= button_to "Run 'Sitemap' task", execute_read_task_path, class: "inline-block border rounded py-1 px-3", method: :post %>