Skip to content

Instantly share code, notes, and snippets.

@chadjemmett
Last active August 29, 2015 14:26
Show Gist options
  • Save chadjemmett/93f2bccbd69353875a96 to your computer and use it in GitHub Desktop.
Save chadjemmett/93f2bccbd69353875a96 to your computer and use it in GitHub Desktop.
require 'sinatra'
#this is the number that goes up or down in value
$thing = 1
#this gets the index page
#
get "/" do
erb :index
#the link to this gist code => https://gist.github.com/ceejaay/801c2e5de59710b1a402#file-index-erb
end
#this is the put request to down vote
put "/thing2" do
$thing = $thing - 1
redirect back
end
#this is the put request to up vote
put "/thing1" do
$thing += 1
redirect back
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment