# Serving static svg images in the public folder

**URL:** <https://www.ruby-forum.com/t/serving-static-svg-images-in-the-public-folder/78149>\
**Category:** Rails\
**Created:** [December 3, 2006, 12:37am UTC](https://www.ruby-forum.com/t/serving-static-svg-images-in-the-public-folder/78149 "2006-12-03T00:37:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![don\_Valentin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@don\_Valentin](https://www.ruby-forum.com/u/don_Valentin)\
**Post date:** [December 3, 2006, 12:37am UTC](https://www.ruby-forum.com/t/serving-static-svg-images-in-the-public-folder/78149/1 "2006-12-03T00:37:26Z")

</div>

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
