Permalink
Browse files

fix score population and line up columns

  • Loading branch information...
1 parent 76b411e commit cd61fb15e8304831d5836bb6002b0d57cb4e4dc8 @mikepmunroe committed Mar 19, 2013
Showing with 5 additions and 5 deletions.
  1. +4 −4 app/models/athlete.rb
  2. +1 −1 app/views/athletes/index.html.erb
View
@@ -42,10 +42,10 @@ def self.populate_scores
leaderboard = Nokogiri::HTML(open(leaderboard_src))
scores = leaderboard.xpath('//table/tbody/tr[@class="highlight"]/td/span[@class="display"]/text()').collect(&:text)
athlete.w1 = scores[0]
- athlete.w2 = scores[1]
- athlete.w3 = scores[2]
- athlete.w4 = scores[3]
- athlete.w5 = scores[4]
+ athlete.w2 = scores[2]
+ athlete.w3 = scores[4]
+ athlete.w4 = scores[6]
+ athlete.w5 = scores[8]
values = []
scores.each do |value|
if (match = value.scan(/\A\d*/))
@@ -3,7 +3,6 @@
<thead>
<tr>
<th>Name</th>
- <th>URL</th>
<th>Affiliate</th>
<th>Age</th>
<th>13.1</th>
@@ -18,6 +17,7 @@
<% @athletes.each do |athlete| %>
<tr>
<td><%= link_to athlete.name, "http://games.crossfit.com#{athlete.url}" %></td>
+ <td><%= athlete.affiliate %></td>
<td><%= athlete.age %></td>
<td><%= athlete.w1 %></td>
<td><%= athlete.w2 %></td>

0 comments on commit cd61fb1

Please sign in to comment.