Forum: Ruby on Rails render or redirect_to??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John MccLain (Guest)
on 2005-12-24 01:49
(Received via mailing list)
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
removed_email_address@domain.invalid
(530)886-1700x235
"Skepticism is the first step toward truth"
Wilson B. (Guest)
on 2005-12-24 04:25
(Received via mailing list)
On 12/23/05, John MccLain <removed_email_address@domain.invalid> 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.
This topic is locked and can not be replied to.