Method: ActionView::Helpers::AssetUrlHelper#font_path

Defined in:
actionview/lib/action_view/helpers/asset_url_helper.rb

#font_path(source, options = {}) ⇒ Object Also known as: path_to_font

Computes the path to a font asset. Full paths from the document root will be passed through.

font_path("font")                                           # => /fonts/font
font_path("font.ttf")                                       # => /fonts/font.ttf
font_path("dir/font.ttf")                                   # => /fonts/dir/font.ttf
font_path("/dir/font.ttf")                                  # => /dir/font.ttf
font_path("http://www.example.com/dir/font.ttf")            # => http://www.example.com/dir/font.ttf


455
456
457
# File 'actionview/lib/action_view/helpers/asset_url_helper.rb', line 455

def font_path(source, options = {})
  path_to_asset(source, { type: :font }.merge!(options))
end