Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building XML API with Grape

I'm building a XML API with the help of the Grape gem. What is the best way to building XML for API actions? Since Grape isn't using standart rails controllers, i can't use views/../xml.builder. What did you suggest? Maybe there are some best practices for building xml api?

like image 422
Mikhail Nikalyukin Avatar asked Aug 21 '12 10:08

Mikhail Nikalyukin


1 Answers

Sinece there are no any answers, i will answer my own question. I ended up with modules where are i declare different kind of xml responses and include this modules into my Grape API. In API actions i just calling response methods from this modules. With this approach my code is clear and separated.

like image 67
Mikhail Nikalyukin Avatar answered Oct 17 '22 00:10

Mikhail Nikalyukin