-
-
Save chrisgaunt/1056165 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", "admin")) | |
template_path = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/stylesheets" | |
old_compile_path = "#{Rails.root}/public/stylesheets/admin" | |
new_compile_path = "#{Rails.root}/tmp/stylesheets/admin" | |
Sass::Plugin::remove_template_location template_path, old_compile_path | |
Sass::Plugin::add_template_location template_path, new_compile_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment