Sha256: 829f9af2ba505f8ca2569284a478ac50ac4d2ee5a4e6fe6461dce476e7f04398

Contents?: true

Size: 726 Bytes

Versions: 4

Compression:

Stored size: 726 Bytes

Contents

module Sinatra
  module Bundles
    # View helpers
    module Helpers
      # Emit a script tag for a javascript bundle
      #
      # @param [Symbol,String] bundle The bundle name
      # @return [String] HTML script tag
      def javascript_bundle_include_tag(bundle)
        sn = request.script_name rescue nil
        settings.javascript_bundles[bundle].to_html(sn)
      end

      # Emit a script tag for a stylesheet bundle
      #
      # @param [Symbol,String] bundle The bundle name
      # @return [String] HTML link tag
      def stylesheet_bundle_link_tag(bundle, media = :all)
        sn = request.script_name rescue nil
        settings.stylesheet_bundles[bundle].to_html(media, sn)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sinatra-bundles-0.5.3 lib/sinatra/bundles/helpers.rb
sinatra-bundles-0.5.2 lib/sinatra/bundles/helpers.rb
sinatra-bundles-0.5.1 lib/sinatra/bundles/helpers.rb
sinatra-bundles-0.5.0 lib/sinatra/bundles/helpers.rb