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

Xavier Noria
Wed, 22 Mar 2006 10:41:24 -0000

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.

-- fxn