Sha256: f584a1c37bec38d45ff342300c22f1dd509fc8cc49c530ec06d53c014010e631
Contents?: true
Size: 592 Bytes
Versions: 94
Compression:
Stored size: 592 Bytes
Contents
module Sinatra::AssetHelpers def stylesheet(s) s += '.css' unless s.include?('.css') s = asset_path(s) unless s =~ /^https?:\// or s =~ /^\/\/\/.+/ "<link rel='stylesheet' href='#{s}' />" end def javascript(s) s += '.js' unless s.include?('.js') s = asset_path(s) unless s =~ /^https?:\// or s =~ /^\/\/\/.+/ "<script type='text/javascript' src='#{s}'></script>" end def asset_path(source, options={}) source = ('/assets/' + source).gsub('//', '/').gsub('/assets/assets/', '/assets/') end def image_path(source) asset_path(source) end end
Version data entries
94 entries across 94 versions & 2 rubygems