Sha256: 330c94d4896fb587679cd0a92e60b35ffa44d02f9c438be63929d9641488545a
Contents?: true
Size: 606 Bytes
Versions: 15
Compression:
Stored size: 606 Bytes
Contents
module Fanforce::Plugin::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
15 entries across 15 versions & 1 rubygems