Permalink
Browse files

hello world

  • Loading branch information...
blake.mizerany@gmail.com
blake.mizerany@gmail.com committed Sep 25, 2007
1 parent 05d0c82 commit 89acb2fcdcd3e032f5d0234300259092c47d8a47
Showing with 30 additions and 0 deletions.
  1. +9 −0 examples/hello/development.log
  2. +20 −0 examples/hello/hello.rb
  3. +1 −0 examples/hello/views/hello.erb
@@ -0,0 +1,9 @@
+GET /erb | Status: 200 | Params: {:format=>"html", :name=>"blake"}
+GET /erb | Status: 200 | Params: {:format=>"html"}
+GET /erb2 | Status: 200 | Params: {:format=>"html"}
+GET /erb2 | Status: 200 | Params: {:format=>"html"}
+GET /erb2 | Status: 200 | Params: {:format=>"html", :name=>"blake"}
+GET /erb2 | Status: 200 | Params: {:format=>"html", :name=>"blake"}
+GET /erb2 | Status: 200 | Params: {:format=>"html", :name=>"blake"}
+GET /erb2 | Status: 200 | Params: {:format=>"html", :name=>"blake"}
+GET /erb | Status: 200 | Params: {:format=>"html", :name=>"blake"}
View
@@ -0,0 +1,20 @@
+$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
+require 'sinatra'
+
+get '/' do
+ "Hello World!"
+end
+
+get '/erb.xml' do
+ header 'Content-Type' => 'application/xml'
+ '<this_is_xml/>'
+end
+
+get '/erb' do
+ erb :hello
+end
+
+get '/erb2' do
+ erb 'Hello <%= params[:name].capitalize || "World" %> 2!'
+end
+
@@ -0,0 +1 @@
+Hello <%= params[:name].capitalize || 'World' %>!

0 comments on commit 89acb2f

Please sign in to comment.