redirect destination to the same page

Asked 2 years ago, Updated 2 years ago, 35 views

I can't find it even if I look into it, so I have a question.
As for how to use redirect_to, I can specify this page, but is it possible to transition to the same page or update the page?

What I want to do is update the page when certain actions occur on the controller.

I don't want you to move pages if possible because there are actions that span multiple pages and it takes a lot of time to move pages every time. Is there such a way?

ruby-on-rails ruby

2022-09-29 22:36

1 Answers

Rails 5 and later
redirect_back(fallback_location:YOUR_PAGE)

Rails 4 and earlier
redirect_to:back

It is possible with . Please enter the path to the page in YOUR_PAGE


2022-09-29 22:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.