Module: Sinatra::SimpleAssets::Helpers

Defined in:
lib/sinatra/simple_assets.rb

Instance Method Summary collapse

Instance Method Details

#javascript(bundle) ⇒ Object



12
13
14
15
16
# File 'lib/sinatra/simple_assets.rb', line 12

def javascript(bundle)
  settings.assets.paths_for("#{bundle}.js").map do |file|
    "<script src=\"#{url(file)}\"></script>"
  end.join("\n")
end

#stylesheet(bundle) ⇒ Object



6
7
8
9
10
# File 'lib/sinatra/simple_assets.rb', line 6

def stylesheet(bundle)
  settings.assets.paths_for("#{bundle}.css").map do |file|
    "<link rel=\"stylesheet\" href=\"#{url(file)}\">"
  end.join("\n")
end