On Oct 20, 8:40 pm, "Mislav Marohnić" <[EMAIL PROTECTED]>
wrote:
> This makes sense to me also. I can't imagine a scenario when I render or
> redirect in a filter where it makes sense to continue with the action.

Will this change prevent this error from occurring anymore?

ActionController::DoubleRenderError

"Render and/or redirect were called multiple times in this action.
Please note that you may only call render OR redirect, and only once
per action. Also note that neither redirect nor render terminate
execution of the action, so if you want to exit an action after
redirecting, you need to do something like \"redirect_to(...) and
return\". Finally, note that to cause a before filter to halt
execution of the rest of the filter chain, the filter must return
false, explicitly, so \"render(...) and return false\"."

I always forget to add "and return false" because having a render or
redirect seems like it should halt the chain to me.

- Trevor


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to