compute_asset_extname

compute_asset_extname(source, options = {}) Instance Public methods Compute extname to append to asset path. Returns nil if nothing should be added.

audio_url

audio_url(source, options = {}) Instance Public methods Computes the full URL to an audio asset in the public audios directory. This will use audio_path internally, so most of their behaviors will be the same. url_to_audio

audio_path

audio_path(source, options = {}) Instance Public methods Computes the path to an audio asset in the public audios directory. Full paths from the document root will be passed through. Used internally by audio_tag to build the audio path. audio_path("horse") # => /audios/horse audio_path("horse.wav") # => /audios/horse.wav audio_path("sounds/horse.wav") # => /aud

asset_url

asset_url(source, options = {}) Instance Public methods Computes the full URL to an asset in the public directory. This will use asset_path internally, so most of their behaviors will be the same. url_to_asset

asset_path

asset_path(source, options = {}) Instance Public methods Computes the path to asset in public directory. If :type options is set, a file extension will be appended and scoped to the corresponding public directory. All other asset *_path helpers delegate through this method. asset_path "application.js" # => /application.js asset_path "application", type: :javascript # => /javascripts/application.js asset_path "application", type: :stylesheet # =>

video_tag

video_tag(*sources) Instance Public methods Returns an html video tag for the sources. If sources is a string, a single video tag will be returned. If sources is an array, a video tag with nested source tags for each source will be returned. The sources can be full paths or files that exists in your public videos directory. Options You can add HTML attributes using the options. The options supports two additional keys for convenience and conformance: :poster - Set an image (like a

stylesheet_link_tag

stylesheet_link_tag(*sources) Instance Public methods Returns a stylesheet link tag for the sources specified as arguments. If you don't specify an extension, .css will be appended automatically. You can modify the link attributes by passing a hash as the last argument. For historical reasons, the 'media' attribute will always be present and defaults to âscreenâ, so you must explicitly set it to âallâ for the stylesheet(s) to apply to all media types. stylesheet_link_tag "style" #

javascript_include_tag

javascript_include_tag(*sources) Instance Public methods Returns an HTML script tag for each of the sources provided. Sources may be paths to JavaScript files. Relative paths are assumed to be relative to assets/javascripts, full paths are assumed to be relative to the document root. Relative paths are idiomatic, use absolute paths only when needed. When passing paths, the â.jsâ extension is optional. If you do not want â.jsâ appended to the path extname: false can be set on the o

image_tag

image_tag(source, options={}) Instance Public methods Returns an HTML image tag for the source. The source can be a full path or a file. Options You can add HTML attributes using the options. The options supports two additional keys for convenience and conformance: :alt - If no alt text is given, the file name part of the source is used (capitalized and without the extension) :size - Supplied as â{Width}x{Height}â or â{Number}â, so â30x45â becomes width=â30â and height=â45â, an

image_alt

image_alt(src) Instance Public methods Returns a string suitable for an html image tag alt attribute. The src argument is meant to be an image file path. The method removes the basename of the file path and the digest, if any. It also removes hyphens and underscores from file names and replaces them with spaces, returning a space-separated, titleized string. Examples image_alt('rails.png') # => Rails image_alt('hyphenated-file-name.png') # => Hyphenated file name image_alt(