Skip to content

Instantly share code, notes, and snippets.

View rriggin's full-sized avatar
📈
+++++++

Ryan Riggin rriggin

📈
+++++++
View GitHub Profile
@rriggin
rriggin / calculator.rb
Created August 16, 2012 01:03 — forked from JoshCheek/calculator.rb
simple sinatra calculator app
# Lets create a simple calculator app together, it should have a get method for localhost:4567/calculator that displays two forms
# the first form should post (note that post is one of those http methods) to localhost:4567/add, and have two fields named "num1" and "num2"
# the second form should post to localhost:4567/subtract with the same args
# the page that they go to should display the result, and have a link to get back to calculator
require 'rubygems'
require 'sinatra'
get '/calculator' do
'