Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RABL and XML formatting

I'm using RABL to format the output of a Rails API I'm creating.

Is there anyway to customize the shape of the XML being produced? For instance, I need to produce an output that uses XML attributes, instead of elements. In other words, this...

<auth status="FAILED" errorcode="UNKNOWN_LOGIN" errormessage=”Error Message” />

Instead of this...

<auth>
   <status type="symbol">failed</status>
   <errorcode>UNKNOWN_LOGIN</errorcode>
   <errormessage>Invalid credentials.</errormessage>
</auth>

Any help will be highly appreciated?

like image 866
Claudio Lassala Avatar asked Jan 29 '26 13:01

Claudio Lassala


1 Answers

I don't think rabl can support xml attributes, but the gem's author is very helpful. I would pose this question at the gem's git home page. https://github.com/nesquena/rabl/issues

like image 111
RTIndy Avatar answered Feb 01 '26 07:02

RTIndy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!