I\'m looking for some clarification regarding the behaviour of redirect_to.
I have this code:
if some_condition
redirect_to(path_one)
From http://api.rubyonrails.org/classes/ActionController/Base.html:
If you need to redirect on the condition of something, then be sure to add “and return” to halt execution.
def do_something
redirect_to(:action => "elsewhere") and return if monkeys.nil?
render :action => "overthere" # won't be called if monkeys is nil
end