Module: SportDbAdmin::ImageHelper

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

Instance Method Summary collapse

Instance Method Details

#flag_for_country(country) ⇒ Object



15
16
17
# File 'app/helpers/sport_db_admin/image_helper.rb', line 15

def flag_for_country( country )
  image_tag( "flags/24x24/#{country.key}.png" )
end

#logo_for_team(team) ⇒ Object



6
7
8
9
10
11
12
13
# File 'app/helpers/sport_db_admin/image_helper.rb', line 6

def logo_for_team( team )
  # 1) check if logo exists
  if Rails.application.assets.find_asset( "logos/24x24/#{team.key}.png" ).present?
    image_tag( "logos/24x24/#{team.key}.png" )
  else
    ''  # return empty string (e.g. nothing)
  end
end