I have two controllers users & movies. All, I want to do, redirect from user#something to movie#something. is it possible??
Use this: return RedirectToAction("LogIn", "Account", new { area = "" }); This will redirect to the LogIn action in the Account controller in the "global" area.
RedirectResult is an ActionResult that returns a Found (302), Moved Permanently (301), Temporary Redirect (307), or Permanent Redirect (308) response with a Location header to the supplied URL. It will redirect us to the provided URL, it doesn't matter if the URL is relative or absolute.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With