module Sprockets::Rails::LegacyAssetTagHelper - sprockets-rails-2.1.3 Documentation

# module Sprockets::Rails::LegacyAssetTagHelper

Backports of AssetTagHelper methods for Rails 2.x and 3.x.

### Public Instance Methods

javascript_include_tag(*sources) click to toggle source

    # File lib/sprockets/rails/legacy_asset_tag_helper.rb, line 9
    def javascript_include_tag(*sources)
      options = sources.extract_options!.stringify_keys
      sources.uniq.map { |source|
        tag_options = {
          "src" => path_to_javascript(source)
        }.merge(options)
        content_tag(:script, "", tag_options)
      }.join("\n").html_safe
    end

stylesheet_link_tag(*sources) click to toggle source

    # File lib/sprockets/rails/legacy_asset_tag_helper.rb, line 19
    def stylesheet_link_tag(*sources)
      options = sources.extract_options!.stringify_keys
      sources.uniq.map { |source|
        tag_options = {
          "rel" => "stylesheet",
          "media" => "screen",
          "href" => path_to_stylesheet(source)
        }.merge(options)
        tag(:link, tag_options)
      }.join("\n").html_safe
    end