Module: SportDbAdmin::LinkHelper

Defined in:
app/helpers/sport_db_admin/link_helper.rb

Instance Method Summary collapse

Instance Method Details



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


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


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