This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
godfathersama
committed
Nov 6, 2014
1 parent
313c112
commit 8f30507
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ def index | |
|
||
def updates | ||
end | ||
|
||
def winner | ||
@user = User.where('username != "mamacias"').order('score DESC') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<h1>The results are in!</h1> | ||
|
||
<% if @user && @user.first.attempts.first %> | ||
<h2>First place</h2> | ||
<p> | ||
<b>Username:</b> <%= @user.first.username %><br/> | ||
<b>Score:</b> <%= @user.first.score %><br/> | ||
<b>Attempt:</b> <%= @user.first.attempts.order('score DESC, created_at ASC').first.attempt %><br/> | ||
</p> | ||
<% else %> | ||
<h2>No participants or attempts</h2> | ||
<% end %> | ||
|