module ActionView::Helpers::AssetUrlHelper
def javascript_path(source, options = {})
javascript_path "http://www.example.com/js/xmlhr" # => http://www.example.com/js/xmlhr
javascript_path "/dir/xmlhr" # => /dir/xmlhr.js
javascript_path "dir/xmlhr.js" # => /assets/dir/xmlhr.js
javascript_path "xmlhr" # => /assets/xmlhr.js
Used internally by +javascript_include_tag+ to build the script path.
Full paths from the document root will be passed through.
If the +source+ filename has no extension, .js will be appended (except for explicit URIs)
Computes the path to a JavaScript asset in the public javascripts directory.
def javascript_path(source, options = {}) path_to_asset(source, { type: :javascript }.merge!(options)) end