Created
June 7, 2011 16:35
-
-
Save hoverlover/1012619 to your computer and use it in GitHub Desktop.
Rails initializer for using ActiveAdmin with Sass on Heroku
This file contains hidden or 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_one = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets" | |
template_path_two = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass" | |
old_compile_path = "#{Rails.root}/public/stylesheets/admin" | |
new_compile_path = "#{Rails.root}/tmp/stylesheets/admin" | |
Sass::Plugin::remove_template_location template_path_one | |
Sass::Plugin::add_template_location template_path_one, new_compile_path | |
Sass::Plugin::remove_template_location template_path_two | |
Sass::Plugin::add_template_location template_path_two, new_compile_path | |
end |
Revision 241545
of this gist is for version 5b534e18
of ActiveAdmin master. Use gist revision d7b763
for ActiveAdmin version 0.2.2.
i used this gist together with http://devcenter.heroku.com/articles/using-sass
problem solved.
Thanks, this fixed for me, too.
Does this error look familiar? I tried this patch to no avail.
ActionView::Template::Error (active_admin.css isn't precompiled):
2012-08-01T22:37:54+00:00 app[web.1]: 6: <title><%= [@page_title, active_admin_application.site_title].compact.join(" | ") %></title>
2012-08-01T22:37:54+00:00 app[web.1]: 7:
2012-08-01T22:37:54+00:00 app[web.1]: 8: <% ActiveAdmin.application.stylesheets.each do |style| %>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works for me. Thanks for contributing!