When redirecting in rails 3,
Is return redirect_to(...) a valid Rails statement?
I've always just used redirect_to(...) and return but I saw a line like the one described above and I was surprised to see that it also worked.
Is
return redirect_to(...)a valid Rails statement?
Yes.
Statement validity is not determined by Rails, it is determined by Ruby. And in Ruby return something is perfectly valid.
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