Hi All,
I'm trying to serve some XML from my Rails 2.0 server.
I have a Flash file that always reads its configuration from /home/gallery.xml
So, I would like to build the contents from the database and serve it back to the flash file when it hits my xml url.
If it was HTML that it was asking for then in my home controller I have a gallery method that serves back a gallery.html.erb but since it wants xml I figured that it would need a gallery.xml.erb and a method like below in my home controller.
def gallery
@collection = Collection.find_by_name("banner")
respond_to do |format| format.html # gallery.html.erb format.xml { render :xml => @collection } end
end
But, this gives me the routing error: No route matches "/home/gallery.xml" with {:method=>:get}
So, I've tried renaming my gallery.xml.erb to gallery.xml.builder but still no luck. I suspect that it's a problem with my understanding of routing but the html version responds as expected through /home/gallery but not /home/gallery.html.
Any help?
Cheers