what does ?body=1 do in rails 3.1 asset pipeline?

Trawling through the Sprocket source code we find: # Returns a 200 OK response tuple def ok_response(asset, env) if body_only?(env) [ 200, headers(env, asset, Rack::Utils.bytesize(asset.body)), [asset.body] ] else [ 200, headers(env, asset, asset.length), asset ] end end body_only? is set when ?body=1 or true For a static asset, Asset.body is defined as: def body # … Read more

How to use compass with rails 3.1

UPDATE: Seems like there is a better way ! Source: http://spin.atomicobject.com/2011/07/12/sass-sprockets-compass-with-rails-3-1/ UPDATE 2(dec 2, 2011): Chris Eppstein, creator of Compass posted this Github Gist of how to integrate Compass with Rails 3.1: https://gist.github.com/1184843 I now prefer this method over mine, as I noticed a great speed improvement at compilation time when using livereload. MY METHOD: … Read more

carrierwave – rails 3.1- undefined method: image_will_change

The OP comments that he fixed it, however there’s no answer set so I thought I’d add one for people coming across this in the future, which included myself until I figured it out 🙂 undefined method `x_will_change!’ for # happens if you forget to add a column in your model’s db table. If you … Read more

Rails 3.1: Determine if asset exists

Given an image in app/assets/images/lolshirts/theme/bg-header.png, Rails.application.assets.find_asset ‘lolshirts/theme/bg-header.png’ => #> Sprockets::StaticAsset:0x80c388ec pathname=”/Users/joevandyk/projects/tanga/sites/lolshirts/app/assets/images/lolshirts/theme/bg-header.png”, mtime=2011-10-07 12:34:48 -0700, digest=”a63cc84aca38e2172ae25de3d837c71a”> Rails.application.assets.find_asset ‘notthere.png’ => nil

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)