Serving static svg images in the public folder

Hi!

I am trying to use svg images and serve them from the public/images
folder.

When using the url_for method I have to use the complete file name
including the extension. Can you explain why? I don’t need to use the
extension for gifs/jpegs/pngs.

Using the complete filename with url_for or writing a direct url to
/public/images I can get the file, but the mime type is text/plain, so
the browser displays it as text.

I have tried using EdgeRails and putting

Mime::Type.register “image/svg+xml”, :svg

into my environment.rb file, but it has not made any difference.

Can you help me to serve public, static svg images in Ruby On Rails?

With kind regards,
Uwe K.
Norway