Skip to content

Instantly share code, notes, and snippets.

@chrisgaunt
Forked from hoverlover/active_admin_heroku.rb
Created June 30, 2011 12:50
Show Gist options
  • Save chrisgaunt/1056165 to your computer and use it in GitHub Desktop.
Save chrisgaunt/1056165 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", "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