Title
Customized Http Response Status and Location
Body

We can set http response status and location while rendering xml response.

See the below example and use following link http://www.codyfauser.com/2008/7/4/rails-http-status-code-to-symbol-mapping to refer http status codes.


          respond_to do |format|
            format.xml  {render :xml => data.to_xml(:root=> "xyz"), :status => :accepted, :location => "xyz.com"}
           }
        end

Cheers
Alok Anand

Rails Detective

Associated Tags
Codes, Http, Https, Location, Rails, Response, Ruby, Status, Xml
Created By
alokanand
Created At
2011-12-16 10:33:12 UTC
Last Updated At
2011-12-16 10:33:12 UTC
Add Comment