[Rails] What is difference between render & redirect methods?

Ben Munat
Wed, 22 Mar 2006 16:36:45 -0000

Xavier Noria wrote:
> On Mar 22, 2006, at 11:21, Tom Mornini wrote:
>
>> This causes a ''server side'' redirect, and causes
>> the other action to be executed without the browser
>> knowing anything about the change.
>
>
> Almost. The action is not executed, only the corresponding template
> list.rhtml is rendered as if the call was
>
>    render :view => ''list'' # imaginary API
>
> being equivalent to
>
>    render :template => "#{controller_name}/list.rhtml"
>
> modulus the template extension. It could even happen that the list
> action renders something else.
>
> Server-side "redirects" are done with render_component.

Hmm, I never knew this... seems like an unfortunate decision, bound to create
confusion.

b