Skip to content

Instantly share code, notes, and snippets.

@ryanwood
Forked from hoverlover/active_admin_heroku.rb
Created October 4, 2011 14:36
Show Gist options
  • Save ryanwood/1261795 to your computer and use it in GitHub Desktop.
Save ryanwood/1261795 to your computer and use it in GitHub Desktop.
Rails initializer for using ActiveAdmin with Sass on Heroku
if Rails.env.production?
require 'fileutils'
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets"))
template_paths = [
"#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets", # Rails 3.1.x (asset pipeline)
"#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass" # Rails 3.0.x
]
old_compile_path = "#{Rails.root}/public/stylesheets"
new_compile_path = "#{Rails.root}/tmp/stylesheets"
template_paths.each do |template_path|
Sass::Plugin::remove_template_location( template_path, old_compile_path )
Sass::Plugin::add_template_location( template_path, new_compile_path )
end
end
@ryanwood
Copy link
Author

ryanwood commented Oct 4, 2011

This was what I came up with to get it all running properly on Heroku Bamboo stack, Rails 3.0.9, Compass 0.11.5, and Active Admin 0.3.1. For some reason the previous gists didn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment