Reputation: 5879
currently i'm using this:
if @part.save
format.xml { render :xml => @part, :status => :created, :location => @part }
else
format.xml { render :xml => @part.errors, :status => :unprocessable_entity }
end
i need a custom response, that is an xml with <result>OK</result>
if the part was correctly saved, and <result>OK</result>
else.
How can i do this?
Thanks!
Upvotes: 3
Views: 2945
Reputation: 7899
Something like this:
render :xml => {:result => "OK"}.to_xml
This renders
<result>OK</result>
Upvotes: 7