Method: Padrino::Helpers::AssetTagHelpers#stylesheet_link_tag

Defined in:
lib/vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers/asset_tag_helpers.rb

Returns an html script tag for each of the sources provided. You can pass in the filename without extension or a symbol and we search it in your appname.public_folder like app/public/stylesheets for inclusion. You can provide also a full path.

Examples:

stylesheet_link_tag 'style', 'application', 'layout'

Parameters:

  • sources (Array<String>)

    Splat of css source paths

  • options (Hash) (defaults to: {})

    The html options for the link tag

Returns:

  • (String)

    Stylesheet link html tag for sources with specified options.



254
255
256
257
258
259
260
# File 'lib/vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers/asset_tag_helpers.rb', line 254

def stylesheet_link_tag(*sources)
  options = sources.extract_options!.symbolize_keys
  options.reverse_merge!(:media => 'screen', :rel => 'stylesheet', :type => 'text/css')
  sources.flatten.map { |source|
    tag(:link, options.reverse_merge(:href => asset_path(:css, source)))
  }.join("\n").html_safe
end