Module: Merb::Assets::AssetHelpers

Module | Merb::Assets::AssetHelpers
In: | lib/merb-assets/assets.rb

Helpers for handling asset files.

### Methods

asset_path

### Constants

ASSET_FILE_EXTENSIONS | = | { :javascript => ".js", :stylesheet => ".css"

### Public Instance methods

asset_path(asset_type, filename, local_path = false)

Returns the URI path to a particular asset file. If `local_path` is true, returns the path relative to the Merb.root, not the public directory. Uses the path_prefix, if any is configured.

#### Parameters

asset_type<Symbol>: | Type of the asset (e.g. :javascript).
filename<~to_s>: | The path to the file.
local_path<Boolean>: | If true, the returned path will be relative to the Merb.root, otherwise it will be the public URI path. Defaults to false.

#### Returns

String: | The path to the asset.

#### Examples

      asset_path(:javascript, :dingo)
      # => "/javascripts/dingo.js"

      asset_path(:javascript, :dingo, true)
      # => "public/javascripts/dingo.js"

[Validate]