What's with this DoubleRenderError?

Another haunting feature of 0.13 is the DoubleRenderError. Jamis explains it purpose:

In order to understand why the DoubleRenderError was necessary, you need to understand something about the render and redirect_to methods that may surprise you. Many programmers expect a call to render or redirect_to to immediately cease execution of their action and return the result back to the browser. This is not the case in Rails. Unless you explicitly return after rendering or redirecting, your action will continue on its merry way as if nothing had happened.

Go read the full thing and you’ll go “ahhhh, thank heavens for DoubleRenderError!”.

blog comments powered by Disqus