about summary refs log tree commit diff
path: root/app/helpers/style_helper.rb
blob: 774407b7fee3921413bff5759606a82dc80d0834 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module StyleHelper
  def stylesheet_for_layout
    if asset_exist? 'custom.css'
      'custom'
    else
      'application'
    end
  end

  def asset_exist?(path)
    if Rails.configuration.assets.compile
      Rails.application.precompiled_assets.include? path
    else
      Rails.application.assets_manifest.assets[path].present?
    end
  end
end