-
-
Save ryanwood/1261795 to your computer and use it in GitHub Desktop.
Rails initializer for using ActiveAdmin with Sass on Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.