Sha256: e85dd3494529a2c5c62612d874af95f4b6e87d8c9c09f0b8090e9a9ab32299f9
Contents?: true
Size: 795 Bytes
Versions: 10
Compression:
Stored size: 795 Bytes
Contents
# encoding: utf-8 #require 'rack/classy_assets' module Sinatra module ClassyAssets module Helpers def stylesheet_tag(sources, options = {}) options = { media: 'screen' }.merge(options) ::ClassyAssets.asset_tag_from(sources, 'css') do |asset_url| %Q{<link href="#{asset_url}" media="#{options[:media]}" rel="stylesheet">} end end def javascript_tag(sources) ::ClassyAssets.asset_tag_from(sources, 'js') do |asset_url| %Q{<script src="#{asset_url}"></script>} end end def asset_url(source) ::ClassyAssets.asset_url_for(source) end end def self.registered(app) #app.use ::Rack::ClassyAssets app.helpers Helpers end end register ClassyAssets end
Version data entries
10 entries across 10 versions & 1 rubygems