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!
Something like this:
render :xml => {:result => "OK"}.to_xml
This renders
<result>OK</result>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With