Forum: Ruby on Rails Serve static XML files how?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ingo W. (Guest)
on 2006-04-18 00:43
(Received via mailing list)
Hi,

a Javascript in one of my Rails templates needs to load a static XML
file. I tried several places to put the actual XML file, and I also
tried to make the file a rails template (tried both .rhtml and .rxml)
and access it via a controller action. None of these ways worked. Does
the lighttpd server know how to serve XML files, or do I need to
configure it first? Or, is there a good workaround?

Ingo W.
Bryan D. (Guest)
on 2006-04-18 00:54
Ingo W. wrote:
> Hi,
>
> a Javascript in one of my Rails templates needs to load a static XML
> file. I tried several places to put the actual XML file, and I also
> tried to make the file a rails template (tried both .rhtml and .rxml)
> and access it via a controller action. None of these ways worked. Does
> the lighttpd server know how to serve XML files, or do I need to
> configure it first? Or, is there a good workaround?
>
> Ingo W.

Why can't you just put it in public/ under 'whatever.xml'? Content under
public gets served static. If for some reason the file is inaccessible,
it may have something to do with Lighty not serving .xml files under the
right MIME type.
This topic is locked and can not be replied to.