Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rails 3.1 Asset Pipeline in the Real World (nodeta.com)
52 points by livedo on June 14, 2011 | hide | past | favorite | 5 comments


The article states that only the filename needs to be passed for CSS url() resources. However, using that method, there appears to be no means to append the MD5 to the precompiled asset filename while in production. The result is an unnecessary trip to the application to generate the asset, bypassing the compiled assets completely.

I believe the preferred method it is to generate your CSS with ERB, using the asset_path method. Though hopefully someone can correct me if I'm wrong.


You're unfortunately correct. This worked initially fine for us, as all resources were served through CDN. However, when images were changed and deployed the results weren't expected.

ERB helpers seem to be the only way currently.


There should be a way to have a sass mixin that generates the md5 timestamp for the asset filename in the sass files, instead of having erb process the whole sass file.


Good read and really love that assets are first-class citizens in Rails. A little off topic, but can anyone point me in the direction of some resources on the biggest changes from 3.0.x to 3.1? Working on an upgrade now and have only played with 3.0.x and would like to know what to expect moving on up to 3.1. Thanks.


Rails 3.1 RC release blog point has good pointers on what has changed.

http://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-ca...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: