I want to build xml from rails application. I wanted to generate tags from rails application database.
For example: I have a database table called cars and it have variable brand and it has values.
So I want to generate xml like this
<dodge> </dodge>
I tried by doing so
xml.cars.brand do
end
cars? What iscars.brand? Is there a car without a brand? And what isxml?Cars.brandwill call thebrandmethod on the class instanceCarsbut in your comment you stated thatbrandis an attribute method of an instance ofCarnot the class itself. Therefor the answer posted is likely to raiseNoMethodErrorforCars, which btw is not the correct model name under rails convention as model names are singular