private Method

AssetTagHelper.rails_asset_id(source)

Use the RAILS_ASSET_ID environment variable or the source’s modification time as its cache-busting asset id.

Source Code

# File action_view/helpers/asset_tag_helper.rb, line 495
def rails_asset_id(source)
  if asset_id = ENV["RAILS_ASSET_ID"]
    asset_id
  else
    path = File.join(ASSETS_DIR, source)

    if File.exist?(path)
      File.mtime(path).to_i.to_s
    else
      ''
    end
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.