Render or redirect_to?

When would I use a render and when would I use a redirect_to? It seems
that
a redirect_to would be so much more common, but there has been an
emphasis
on rendering in rails

John McClain
Senior Software Engineer
TCS Healthcare
[email protected]
(530)886-1700x235
“Skepticism is the first step toward truth”

On 12/23/05, John MccLain [email protected] wrote:

When would I use a render and when would I use a redirect_to? It seems that
a redirect_to would be so much more common, but there has been an emphasis
on rendering in rails

render() means “User got to the right place, and now it’s time to
generate HTML for them to display.”
redirect_to() means “We can’t handle things in this action/controller,
so we’re telling the user’s browser to go elsewhere.”

Put another way, render() produces results without changing the URL
displayed in the client browser, redirect_to() sends them elsewhere.

–Wilson.