Skip to content
Browse files

adding ability to start a game

  • Loading branch information...
1 parent 6ba2f97 commit d7fea0be26de7f09ade1b11c780d39b00f7f8772 @joshuaflanagan committed Sep 26, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 app.rb
View
14 app.rb
@@ -64,6 +64,15 @@ def users
redirect '/'
end
+post '/challenge' do
+ opponent_id = params[:opponent]
+ opponent = users.find_one({:identity => opponent_id})
+ return "Who? <a href='/'>Try again</a>" if opponent.nil?
+ # start a game
+ redirect '/'
+end
+
+
post '/login/openid' do
openid = params[:openid_identifier]
begin
@@ -124,6 +133,11 @@ def users
%input{ :type => 'submit', :value => 'Login' }
- else
%a{ :href => '/settings' } Settings
+ %form{ :action => "/challenge", :method => "post" }
+ %label
+ Opponent ID:
+ %input{ :type => "text", :name => "opponent" }
+ %input{ :type => "submit", :value => "Challenge" }
@@ settings
= haml :login_status, :layout => false

0 comments on commit d7fea0b

Please sign in to comment.
Something went wrong with that request. Please try again.