Sha256: 3f17b790aafaeadbf8fd6afdc6b14c13aa08c2bae5146488e291226c1a2fa692
Contents?: true
Size: 603 Bytes
Versions: 35
Compression:
Stored size: 603 Bytes
Contents
module Fanforce::App::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
35 entries across 35 versions & 1 rubygems