Questions regarding the redirect method in ruby on rails.

Asked 2 years ago, Updated 2 years ago, 135 views

Let's go to the previous page Questions regarding the redirect method.

1. redirect : back

2. redirect_back(fallback_location: root_path)

When I wrote the first code, it said "undefined method" and there was an error It works fine with the second code works fine

What's the difference?

ruby-on-rails ruby redirect method

2022-09-22 08:05

1 Answers

I think it's a typo. You can do redirect_to:back but since 5.1 we don't support it I recommend using the second one.


2022-09-22 08:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.