I’ve got a little issue with rails, I want to be able to do something like this to avoid multiple redirections :
def render_not_found
not_found
end
private
def not_found
redirect_to website_url(@website), :status => 301 and return return
end
return return doesn’t work of course!
Using: rails 3.2.0
There’s a few ways to do this. One way is to define and raise a custom error, and have a handler that redirects when that happens.
application_controller.rb
in your controller
or in a before filter