Redirect_to vs render

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

2008/8/6 Palani K. [email protected]:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs