questionmark syntax

This commit is contained in:
Andrew Tomaka 2015-04-28 10:41:58 -04:00
parent 5c7842f37d
commit 8926bd6c05

4
app.rb
View file

@ -31,8 +31,8 @@ post '/' do
end end
end end
get '/bossfight/?:username' do get '/bossfight' do
@username = params['username'] != '' ? params['username'] : 'mafiaman' @username = params['username'] ? params['username'] : 'mafiaman'
user_raids = Raid.for_user(@username) user_raids = Raid.for_user(@username)
@first_negative = user_raids.first_negative @first_negative = user_raids.first_negative
@soldiers_killed = user_raids.soldiers_lost_to_date(@first_negative.created_at) @soldiers_killed = user_raids.soldiers_lost_to_date(@first_negative.created_at)