Skip to content

Instantly share code, notes, and snippets.

@jedediah
Created July 1, 2009 02:01
Show Gist options
  • Save jedediah/138553 to your computer and use it in GitHub Desktop.
Save jedediah/138553 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'sinatra/strands'
require 'haml'
helpers do
def message locals={}
haml :message,
:locals => {:uri => strand_uri }.merge(locals)
end
end
strand_get '/' do
show message :text => "Step 1: click this button", :button => "ok"
show message :text => "Step 2: click it again", :button => "yup"
show message :text => "Step 3: one more time baby", :button => "oh yeah"
message :text => "Ok, you're done", :button => "again", :uri => '/'
end
__END__
@@ message
%html
%head
%title A Poignant Message From The Internet
%body
%h1= text
%a{:href => uri, :style => "border: 1px solid black; padding: 10px" }= button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment