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