sinatra-static-assets/test/sinatra_app.rb

22 lines
344 B
Ruby
Raw Normal View History

2009-07-05 16:00:34 +00:00
require 'rubygems'
require 'sinatra'
require 'sinatra/url_for'
2009-07-05 16:28:12 +00:00
require 'sinatra/static_assets'
2009-07-05 16:00:34 +00:00
2009-07-05 16:28:12 +00:00
get "/url_for" do
2009-07-05 16:00:34 +00:00
content_type "text/plain"
<<"EOD"
#{url_for("/")}
#{url_for("/foo")}
#{url_for("/foo", :full)}
EOD
end
2009-07-05 16:28:12 +00:00
get "/image_tag" do
content_type "text/plain"
<<"EOD"
#{image_tag("/images/foo.jpg", :alt => "[foo image]")}
EOD
end