about summary refs log tree commit diff
path: root/app/helpers/style_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/style_helper.rb')
-rwxr-xr-xapp/helpers/style_helper.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/style_helper.rb b/app/helpers/style_helper.rb
new file mode 100755
index 000000000..774407b7f
--- /dev/null
+++ b/app/helpers/style_helper.rb
@@ -0,0 +1,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