Forum: Ruby on Rails redirect_to with hash vs string and docs

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.
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-05-12 05:19
(Received via mailing list)
Hi,

When I use redirect_to with a string (eg. redirect_to
"http://www.yahoo.com"), the browser is sent a response with a header
containing status 302. This is good for what I am doing.

If I use redirect_to with a hash (eg. redirect_to :action=>'list'),
the browser is sent a response with status 200 and the body contains
the destination of the redirection. This saves one back and forth
between the user and the server. This is good for other situations I'm
sure but redirect_to() documentation does not explain this important
difference.

Do I understand the two behaviors correctly?

Thanks,
Peter
This topic is locked and can not be replied to.