Mflynn37211/Gametime — pull request #1 by hchood (2014-08-25 17:40:55+00:00)
Title: Hh refactor

Hi Michael,

Nice work! I like the image and styling :) I made a few edits on this branch. You can see the full changes by clicking the "Files changed" tab in this pull request.

Some bigger-picture thoughts:

**Methods.** I'd try refactoring a lot of the logic in the `get '/leaderboard'` block into methods, like you did for the `team_info` and `sort_teams` methods. ideally, you want to call one method in your GET block to create each instance variable, and then render a template, and that's it.

**Data structure.** I'd probably create a single data structure to hold all of the information about teams' wins and losses. That way all the data is linked and you could more easily do things like sorting teams by wins and losses at the same time. I might have something like:

```ruby
```ruby
@team_records = {
"Patriots" => { wins: 3, losses: 0 },
"Broncos" => { wins: 1, losses: 1 },
"Colts" => { wins: 0, losses: 2 },
"Steelers" => { wins: 0, losses: 1 }
}
```

Very nice work overall. Let me know if you have any questions :)

Helen