Class/Module Index [+]

Quicksearch

Sinatra::StaticAssets::Helpers

Public Instance Methods

image_tag(source, options = {}) click to toggle source

In HTML <link> and <img> tags have no end tag. In XHTML, on the contrary, these tags must be properly closed.

We can choose the appropriate behaviour with closed option:

image_tag "/images/foo.png", :alt => "Foo itself", :closed => true

The default value of closed option is false.

# File lib/sinatra/static_assets.rb, line 32
def image_tag(source, options = {})
  options[:src] = url_for(source)
  tag("img", options)
end
javascript_script_tag(*sources) click to toggle source
# File lib/sinatra/static_assets.rb, line 42
def javascript_script_tag(*sources)
  list, options = extract_options(sources)
  list.collect { |source| javascript_tag(source, options) }.join("\n")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.