repo.or.cz
/
sinatra.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* Pretty up default pages
[sinatra.git]
/
examples
/
hello
/
hello.rb
blob
89a9a32942d8fad0495a2eb5eaf9976c17756025
1
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
2
require 'sinatra'
3
4
# get '/' do
5
# "Hello World!"
6
# end
7
8
get '/erb.xml' do
9
header 'Content-Type' => 'application/xml'
10
'<this_is_xml/>'
11
end
12
13
get '/erb' do
14
erb :hello
15
end
16
17
get '/erb2' do
18
erb 'Hello <%= params[:name].capitalize || "World" %> 2!'
19
end
20