redirect_to vs render

P

Palani Kumar

Can any one explain me what is the difference between redirect_to and
render.I am newbie. i am bit confuesd about those two.
 
S

Stefan Lang

2008/8/6 Palani Kumar said:
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/rubyonrails-talk).

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top