instance method
compute_asset_extname
Ruby on Rails 6.0.6
Since v4.0.13Signature
compute_asset_extname(source, options = {})
Compute extname to append to asset path. Returns nil if nothing should be added.
Parameters
-
sourcereq -
optionsopt = {}
Source
# File actionview/lib/action_view/helpers/asset_url_helper.rb, line 240
def compute_asset_extname(source, options = {})
return if options[:extname] == false
extname = options[:extname] || ASSET_EXTENSIONS[options[:type]]
if extname && File.extname(source) != extname
extname
else
nil
end
end
Defined in actionview/lib/action_view/helpers/asset_url_helper.rb line 240
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::AssetUrlHelper