Redirect One Controller to another Controller
37,691
Solution 1
Yes. Look at redirect_to. http://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_to
Solution 2
redirect_to controller: :controllername, action: :actionname'
where controllername is the name of your controller and actionname is the name of your action. this works for rails 4 but should also work for older versions of rails
Author by
Adnan
Updated on September 07, 2021Comments
-
Adnan over 2 years
I have two controllers users & movies. All, I want to do, redirect from user#something to movie#something. is it possible??