v3.1.0 - Show latest stable - 0 notes - Class: AssetPaths
compute_public_path(source, dir, ext = nil, include_host = true, protocol = nil) public

Add the extension ext if not present. Return full or scheme-relative URLs otherwise untouched. Prefix with /dir/ if lacking a leading /. Account for relative URL roots. Rewrite the asset path for cache-busting asset ids. Include asset host, if configured, with the correct request protocol.

When include_host is true and the asset host does not specify the protocol the protocol parameter specifies how the protocol will be added. When :relative (default), the protocol will be determined by the client using current protocol When :request, the protocol will be the request protocol Otherwise, the protocol is used (E.g. :http, :https, etc)

Show source
Register or log in to add new notes.