1

I want to put some rather large sound files into my assets folder in rails.

/app/assets/sounds
--- file1.wav
----file2.wav

when calling them thru the following URL

http://localhost:3000/assets/file1.wav

Rails (3.2.x) the file will be "served" (somehow) but I can never play it in the browser.

If however I put those files into the public folder they will be served and can be played.

I assume this is related to the fact that the public folder isn't touched by rails but is served by rack (afaik). I found a solution to use send_file but is this really needed?

robkuz
  • 9,488
  • 5
  • 29
  • 50
  • 1
    Is there a reason you are trying to put them in the asset pipeline instead of /public? – DVG Sep 05 '12 at 17:21
  • I will have a lot of these media assets belonging to different "modules" so that I will need to group them by subfolders. – robkuz Sep 06 '12 at 09:10
  • The issue seems to be one of file size and not of location of files. If the file is to big it will neither be served from the assets folder nor from the public folder. If the size however is sufficiently small enough it will be served from either one. Which makes me think that this is more of a Rack issue (I am using either Brick or Mongrel) than a rails issue. – robkuz Sep 06 '12 at 12:44
  • Actually I found the solution. First of all - Rails works like it should! My Problem was that I was trying to serve large WAV files to Chrome. For some reasons Chrome doesnt want to read larger WAF files. MP3 work fine from either "public" or "assets" and WAV work fine for Opera, FF and Safari. Wow. I totally wasted the better of a day to "fix rails" especially as it seemed from various sources that large files are an issue. /facepalm – robkuz Sep 07 '12 at 02:54

0 Answers0