summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/admin_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index afed245..6c3cbc6 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -1,4 +1,13 @@
1module AdminHelper 1module AdminHelper
2 def language_selector
3 case I18n.locale
4 when :de
5 link_to raw('<span class="inactive">English</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'en'))
6 when :en
7 link_to raw('<span class="inactive">Deutsch</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'de'))
8 end
9 end
10
2 def mtime_busted_path(path) 11 def mtime_busted_path(path)
3 file = Rails.public_path.join(path.sub(%r{\A/}, "")) 12 file = Rails.public_path.join(path.sub(%r{\A/}, ""))
4 raise "Static asset not found for cache-busting: #{path} (looked for #{file})" unless File.exist?(file) 13 raise "Static asset not found for cache-busting: #{path} (looked for #{file})" unless File.exist?(file)