Sha256: 59d85e06b1b44f83bcc8611599fe38cbbf5779a8a18d88b25da8c946345ff495
Contents?: true
Size: 588 Bytes
Versions: 40
Compression:
Stored size: 588 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
40 entries across 40 versions & 2 rubygems