The Empty Flask

Refinery CMS + Sass + Heroku

It was frustrating to get this combination to work, since Heroku uses a read-only filesystem (except for /tmp), and if application.css doesn't exist in /public/stylesheets, Refinery will serve its own default CSS.

So in case you're trying to do something similar, here's what I did (or view in Gist form):

config/initializers/haml.rb:
Sass::Plugin.options[:style] = :compact
Sass::Plugin.options[:template_location] = "#{Rails.root}/public/stylesheets/sass"
Sass::Plugin.options[:css_location] = "#{Rails.root}/tmp/public/stylesheets/compiled"

config.ru:
use Rack::Static, :root => "tmp/public/", :urls => ["/stylesheets/compiled"]

Then, just load /stylesheets/compiled/application.css.

Categories

Other Posts

RSS Feed

Subscribe

Archives