Skip to content

Instantly share code, notes, and snippets.

Created December 28, 2012 00:39
Show Gist options
  • Save anonymous/4393517 to your computer and use it in GitHub Desktop.
Save anonymous/4393517 to your computer and use it in GitHub Desktop.
index.rb
require 'sinatra'
require './lib/game'
require './lib/problem_set'
get '/' do
@game = Game.new
@problem = ProblemSet.random
erb :index
end
post '/answer' do
"Hello World '#{params[:answer]}'"
end
index.erb
Problem Set</br>
<%= @problem %>
<form action="/answer" method="post">
<input type="text" name="answer">
<input type="submit">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment