Is there a way to use external XML (or JSON) as a datasource for models in Rails. E.g. some models use the database for getting data, others "ping" external services for XML.
A:
You could override the 'get' methods on the model, to look at your xml (or xml server) instead of looking at the database.
To parse xml on ruby, there are many apis, like rexml and xmlsimple.
Here there's a comparison between both.
Gabriel L. Oliveira
2010-09-18 14:13:44
+2
A:
You can use ActiveResource for this - it's already part of Rails, and is intended to allow you to integrate with external restful services.
Mr. Matt
2010-09-18 14:31:41
This looks like it, thanks!
IvanBernat
2010-09-18 14:45:21