style_helper.rb 383 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module StyleHelper
  3. def stylesheet_for_layout
  4. if asset_exist? 'custom.css'
  5. 'custom'
  6. else
  7. 'application'
  8. end
  9. end
  10. def asset_exist?(path)
  11. if Rails.configuration.assets.compile
  12. Rails.application.precompiled_assets.include? path
  13. else
  14. Rails.application.assets_manifest.assets[path].present?
  15. end
  16. end
  17. end