Hey I am wondering what the location option for the render method in rails is. The docs here http://guides.rubyonrails.org/layouts_and_rendering.html states:
\"You can
The Location header
is for redirecting the page.
Actually location
option is used to redirect to a new resource as part of processing the request. For example,
render :xml => post.to_xml, :status => :created, :location => post_url(post)
is telling the recipient that a XML file for the post is created and you will get this from post_url(post)
. Hence GO THERE ;)
render
method does this by setting the Location
option in response object
... ... ...
if location = options[:location]
response.headers["Location"] = url_for(location)
end
... ... ...
You can find details about Location
header here http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30.