Prevent assets/stylesheets loading into heroku application

时间:2015-07-28 16:20:48

标签: css ruby-on-rails heroku

I currently have an application deployed here: https://morning-shelf-1378.herokuapp.com/job-fairs

As you can see it has combined the style-sheets from ActiveAdmin assets/stylesheets into the application causing the font to be underlined etc. when I only want it to be displayed on https://morning-shelf-1378.herokuapp.com/admin/.

Is there a way to specify the stylesheets from ActiveAdmin to not be displayed by default? When I deploy locally everything seems to be fine.

Rails.application.configure do

 config.cache_classes = true

 config.eager_load = true

 config.consider_all_requests_local       = false
 config.action_controller.perform_caching = true

 config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

 config.assets.js_compressor = :uglifier

 config.assets.compile = false

 config.assets.digest = true

 config.log_level = :debug
 config.i18n.fallbacks = true


 config.active_support.deprecation = :notify

 config.log_formatter = ::Logger::Formatter.new

 config.active_record.dump_schema_after_migration = false
end

1 个答案:

答案 0 :(得分:0)

In your app/assets/stylesheets/application.css file you need to remove this line

 *= require_tree .

or move your app/assets/stylesheets/active_admin.css.scss and app/assets/javascripts/active_admin.js.coffee files into vendor/assets/stylesheets/ andvendor/assets/javascripts directory

or comment this lines in production.rb file

 # config.assets.js_compressor = :uglifier
 # config.assets.compile = false
 # config.assets.digest = true