Module: Sprockets::Helpers::RailsHelper
- Defined in:
- lib/i18n/assets/sprockets.rb
Instance Method Summary collapse
-
#asset_path(source, options = {}) ⇒ Object
(also: #path_to_asset)
prevent asset from caching by adding timestamp.
- #asset_path_without_locale ⇒ Object
Instance Method Details
#asset_path(source, options = {}) ⇒ Object Also known as: path_to_asset
prevent asset from caching by adding timestamp
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/i18n/assets/sprockets.rb', line 23 def asset_path(source, = {}) path = asset_path_without_locale(source, ) if !digest_assets? && Sprockets.localizable?(path) separator = path =~ /\?/ ? '&' : '?' "#{ path }#{ separator }t=#{ Time.now.to_i }" else path end end |
#asset_path_without_locale ⇒ Object
20 |
# File 'lib/i18n/assets/sprockets.rb', line 20 alias_method :asset_path_without_locale, :asset_path |