Rails display data from XML file via respond_to format.json

uvaraj6

New Member
I have an XML file containing text data that I need to display to the user. I am using ember.js and therefore need to provide my response in json format.My initial thoughts are to load the XML file and convert it to json using XSLT and then rendering this. However, I don't fully understand how the respond_to format.json method works. At a guess, I would say it turns the result of the instance variable into json, so if my data is already in json would it cause me any issues using this approach?What is the best way to render my XML file to a view in json?
 
Back
Top