Module: SportDbAdmin::LinkHelper
- Defined in:
- app/helpers/sport_db_admin/link_helper.rb
Instance Method Summary collapse
- #link_to_country(country) ⇒ Object
- #link_to_event(event, opts = {}) ⇒ Object
- #link_to_team(team) ⇒ Object
Instance Method Details
#link_to_country(country) ⇒ Object
6 7 8 |
# File 'app/helpers/sport_db_admin/link_helper.rb', line 6 def link_to_country( country ) link_to( country.title, short_country_path( country ) ) end |
#link_to_event(event, opts = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/sport_db_admin/link_helper.rb', line 14 def link_to_event( event, opts={} ) if (opts[:full].present? || opts[:full_title].present? || opts[:fulltitle].present? ) # show league title + season title (a.k.a full_title) # e.g. Primera División 2013/14 link_to( event.title, short_event_path( event )) elsif opts[:league].present? # show only league (w/o season title) # e.g. Primera División link_to( event.league.title, short_event_path( event )) else # season: true (default) # show only season (w/o league title) # e.g. 2013/14 or 2014 link_to( event.season.title, short_event_path( event )) end end |
#link_to_team(team) ⇒ Object
10 11 12 |
# File 'app/helpers/sport_db_admin/link_helper.rb', line 10 def link_to_team( team ) link_to( team.title, short_team_path( team ) ) end |