[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

redirect_to vs render

Palani Kumar

8/6/2008 10:35:00 AM

Can any one explain me what is the difference between redirect_to and
render.I am newbie. i am bit confuesd about those two.
--
Posted via http://www.ruby-....

1 Answer

Stefan Lang

8/6/2008 12:06:00 PM

0

2008/8/6 Palani Kumar <palani.apk@gmail.com>:
> Can any one explain me what is the difference between redirect_to and
> render.I am newbie. i am bit confuesd about those two.

redirect_to generates a response that, instead of delivering
content to the browser, just tells it to request another url.

render causes rails to generate a response whose content
is produced by rendering one of your templates.

So redirect_to is just telling the browser "hey, the stuff you're
looking for is not here, it's over there!" while render is actually
delivering content.

It would be better to post Rails specific questions to
rubyonrails-talk (http://groups.google.com/group/rubyon...).

Stefan