diff --git a/app/assets/stylesheets/bootstrap-complete.scss b/app/assets/stylesheets/bootstrap-complete.scss index df03c6ad0..0e49df681 100644 --- a/app/assets/stylesheets/bootstrap-complete.scss +++ b/app/assets/stylesheets/bootstrap-complete.scss @@ -1,7 +1,7 @@ // Calling this file bootstrap would cause an infinite recursion during asset compilation. @import "bootstrap-sprockets"; @import "bootstrap-variables"; //our overwrites of bootstrap variables -@import "bootstrap"; +@import "_bootstrap"; // Plugins diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index b8d5fb65f..33e369e29 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -3,8 +3,16 @@ # bootstrap-markdown plugin relies on rails-assets-bootstrap gem but we use # bootstrap-sass this line makes sure we exclude every asset comming # from rails-assets-bootstrap to prevent conflicts with bootstrap-sass -Rails.configuration.assets.paths.reject! do |path| - path.include?("rails-assets-bootstrap") && !path.include?("rails-assets-bootstrap-markdown") + +# See https://github.com/tenex/rails-assets/issues/314 +Rails.application.config.after_initialize do + # add the gem names you wish to reject to the below array + excluded_gem_names = ["rails-assets-bootstrap"] + + excluded_gem_full_names = Gem::Specification.select {|g| excluded_gem_names.include? g.name }.flat_map(&:full_name) + Rails.application.config.assets.paths.reject! do |path| + excluded_gem_full_names.any? {|gem_name| path.include? gem_name } + end end # Version of your assets, change this if you want to expire all your assets.