Skip to content

Commit

Permalink
refactor: use a decorator to present the start list
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinW520 committed Aug 6, 2019
1 parent 9d03945 commit 3843ce8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/decorators/participant_decorator.rb
Expand Up @@ -3,6 +3,10 @@ def address_html
"#{address}<br />#{city}, #{state}, #{zip}"
end

def city_and_state
"#{participant.city.try(:titleize)}, #{participant.state.try(:upcase)}"
end

def full_name
"#{first_name} #{last_name}"
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/participants/_table_row.html.haml
Expand Up @@ -3,6 +3,6 @@
%td= participant.last_name
%td= participant.division[0].upcase
%td= participant.race_day_age
%td #{participant.city}, #{participant.state}
%td= participant.city_and_state
- if participant.event.allows_teams?
%td= participant.team_name

0 comments on commit 3843ce8

Please sign in to comment.