about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/style_helper.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/style_helper.rb b/app/helpers/style_helper.rb
new file mode 100644
index 000000000..b695f8f3e
--- /dev/null
+++ b/app/helpers/style_helper.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module StyleHelper
+  def stylesheet_for_layout
+    if asset_exist? 'custom.css'
+      'custom'
+    else
+      'application'
+    end
+  end
+
+  def asset_exist?(path)
+    true if Webpacker::Manifest.lookup(path)
+  rescue Webpacker::FileLoader::NotFoundError
+    false
+  end
+end