Skip to content

Instantly share code, notes, and snippets.

@ashbb
Created February 17, 2012 12:23
Show Gist options
  • Select an option

  • Save ashbb/1853092 to your computer and use it in GitHub Desktop.

Select an option

Save ashbb/1853092 to your computer and use it in GitHub Desktop.
A small sample snippet to use Shoes.url.
class PhotoFrame < Shoes
url '/', :index
url '/a', :a
url '/b', :b
url '/c', :c
def index
a
end
def a
para 'This is a. Go to b after 3sec'
timer(3){visit '/b'}
end
def b
para 'This is b. Go to c if you press space bar.'
keypress{|k| visit '/c' if k == ' '}
end
def c
para 'This is c. Go back a if you press space bar.'
keypress{|k| visit '/a' if k == ' '}
end
end
Shoes.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment