This post originated from an RSS feed registered with Ruby Buzz
by David Heinemeier Hansson.
Original Post: Whatâs with this DoubleRenderError?
Feed Title: Riding Rails
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: The knowledge diff for all things Rails
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!”.