Sha256: cc6cc4639213861e29175cb81b3103cf77fc8fc80f8b54b6779540dfd89cea43

Contents?: true

Size: 921 Bytes

Versions: 32

Compression:

Stored size: 921 Bytes

Contents

require 'sprockets'

module Sprockets
  module Rails
    # Backports of AssetTagHelper methods for Rails 2.x and 3.x.
    module LegacyAssetTagHelper
      include ActionView::Helpers::TagHelper

      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

      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
    end
  end
end

Version data entries

32 entries across 31 versions & 7 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/legacy_asset_tag_helper.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.3.3 lib/sprockets/rails/legacy_asset_tag_helper.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sprockets-rails-2.3.2/lib/sprockets/rails/legacy_asset_tag_helper.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sprockets-rails-2.3.1/lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.3.2 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.3.1 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.3.0 lib/sprockets/rails/legacy_asset_tag_helper.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.2.4 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.2.3 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.2.2 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.2.1 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.2.0 lib/sprockets/rails/legacy_asset_tag_helper.rb
sprockets-rails-2.1.4 lib/sprockets/rails/legacy_asset_tag_helper.rb