Cleaning up your views with Simple Delegators
While working on my pet project for matching tennis partners I decided to make a match history page. It displays a player's recent matches and some information pertaining to them: who played when, who won, and how much that win affected their score on the site. I also wanted each match history log to be separated by color-coded boxes.
This was the end result:
The first solution I came up with used a bunch of if
statements and some messy view lo…