method
rails_asset_id
v3.0.9 -
Show latest stable
- Class:
ActionView::Helpers::AssetTagHelper
rails_asset_id(source)private
Use the RAILS_ASSET_ID environment variable or the source’s modification time as its cache-busting asset id.
# File actionpack/lib/action_view/helpers/asset_tag_helper.rb, line 787
def rails_asset_id(source)
if asset_id = ENV["RAILS_ASSET_ID"]
asset_id
else
if @@cache_asset_timestamps && (asset_id = @@asset_timestamps_cache[source])
asset_id
else
path = File.join(config.assets_dir, source)
asset_id = File.exist?(path) ? File.mtime(path).to_i.to_s : ''
if @@cache_asset_timestamps
@@asset_timestamps_cache_guard.synchronize do
@@asset_timestamps_cache[source] = asset_id
end
end
asset_id
end
end
end Related methods
- Instance methods
- audio_path
- audio_tag
- auto_discovery_link_tag
- favicon_link_tag
- image_path
- image_tag
- javascript_include_tag
- javascript_path
- path_to_audio
- path_to_image
- path_to_javascript
- path_to_stylesheet
- path_to_video
- stylesheet_link_tag
- stylesheet_path
- video_path
- video_tag
- Class methods
- register_javascript_expansion
- register_javascript_include_default
- register_stylesheet_expansion
- reset_javascript_include_default
- Private methods
-
asset_file_path -
asset_file_path! -
collect_asset_files -
compute_asset_host -
compute_javascript_paths -
compute_public_path -
compute_stylesheet_paths -
determine_source -
ensure_javascript_sources! -
ensure_stylesheet_sources! -
expand_javascript_sources -
expand_stylesheet_sources -
is_uri? -
javascript_src_tag -
join_asset_file_contents -
rails_asset_id -
rewrite_asset_path -
rewrite_extension? -
rewrite_host_and_protocol -
stylesheet_tag -
write_asset_file_contents