Topic: Rails - Consuming local JSON API from another controller
I am building an App that serves as the backend for an android app as well as a rails webapp. To serve as a back end, I have built a series of api controllers ( ex: api_users contoller with actions show, update etc.) which will return a JSON/ XML output (using RABL).
In my Webapp, when it is time to update the User profile say, I simply want to call the update action of the api_users controller and parson the json output in my User's controller, parse this output and then handoff the data to my view etc. How do I go about making such calls?
A very bad workaround seems to be to treat it like any external API and call it using Net::Http etc. It seems really strange that I should be able to consume an external api easily but not my local API. Can somebody help/ guide me to the recommended way of doing this?