Skip to content

Commit

Permalink
Using redirect_back_or_to
Browse files Browse the repository at this point in the history
  • Loading branch information
hmdros committed Oct 3, 2023
1 parent 9d91c8c commit dead939
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/views/shared/_navigation_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</li>

<li class="mr-3">
<%= 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 %>
</li>

<li class="mr-3 ml-auto flex items-center">
Expand Down

0 comments on commit dead939

Please sign in to comment.