require "rubygems" require "sinatra" use_in_file_templates! get "/" do erb :home end get "/go" do erb :go end get "/internal_redirect" do redirect "/" end get "/external_redirect" do redirect "http://google.com" end post "/go" do @user = params[:name] @email = params[:email] erb :hello end __END__ @@ layout
visit there
@@ go @@ helloHello, <%= @user %>
Your email is: <%= @email %>