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