| Module | ResultsHelper |
| In: |
app/helpers/results_helper.rb
|
Link to Person Result detail page
# File app/helpers/results_helper.rb, line 3
3: def link_to_results(text, result)
4: return text unless result.person_id
5:
6: if result.preliminary?
7: html_options = ' class="preliminary"'
8: end
9:
10: if result.competition_result?
11: "<a href=\"/events/#{result.event_id}/people/#{result.person_id}/results##{result.race_id}\"#{html_options}>#{text}</a>"
12: else
13: "<a href=\"/people/#{result.person_id}/#{result.year}\"#{html_options}>#{text}</a>"
14: end
15: end
Link to Person Result detail page
# File app/helpers/results_helper.rb, line 18
18: def link_to_team_results(text, result)
19: return text unless result.team_id
20:
21: if result.team_competition_result?
22: "<a href=\"/events/#{result.event_id}/teams/#{result.team_id}/results/#{result.race_id}\">#{text}</a>"
23: else
24: "<a href=\"/teams/#{result.team_id}/#{result.year}\">#{text}</a>"
25: end
26: end
# File app/helpers/results_helper.rb, line 38
38: def result_cell(result, column)
39: case column
40: when "first_name"
41: link_to_results result.first_name, result
42: when "last_name"
43: link_to_results result.last_name, result
44: when "name"
45: link_to_results result.name, result
46: when "team_name"
47: if RacingAssociation.current.unregistered_teams_in_results? || result.team.try(:member?) || result.year < RacingAssociation.current.year
48: link_to_team_results result.team_name, result
49: end
50: else
51: result.send ResultColumn[column].display_method
52: end
53: end
# File app/helpers/results_helper.rb, line 32
32: def result_cell_class(column)
33: if ResultColumn[column].alignment == :right
34: " class=\"right\""
35: end
36: end