config.assets.digest = true seems to be preventing assets precompile with SWF files (Rails 3.1.0)

Having the config.assets.digest = true in environment/production.rb seems to prevent pre-compilation of swf assets. Disabling this flag, and running rake assets:precompile will compile all the asset files with their hashes. You can then turn the flag back on and access the compiled assets.

When precompilling my assets my swf file not being precompiled would cause the rake task to fail. I’ve added the custom assets path via

config.assets.paths << “#{Rails.root}/vendor/assets/flash”

to application.rb

I’m using the asset_path from within a js.coffee.erb file as “<%= asset_path(‘Jplayer.swf’) %>”

I’m developing on a linux 32bit ubuntu 11.04, with ruby 1.9.2-p290 on rails 3.1.0.

Hi Jason, could you please fill an issue here

https://github.com/rails/rails/issues

?

Thanks I"ll file the bug.

A little but of updated information for anyone that finds this thread. The issue seems to revolve around generating URL + hash for an swf file. Even with the flag enabled, the swf file has a hash value appended to its name when it’s copied to the public/assets folder, but as soon as a js.coffee.erb (maybe others) file uses assets_path helper it is unable to build the precompiled URL+hash.

Disabling the flag, compiling, and then enabling it allows production to work, but no static files will be served up since the URLs are all pointing to the assets original name which will be served by the rails app.

Just checked with rails 3.1.1 and this issue no longer is a problem.