Module: ActiveScaffold::Bridges::CountrySelect::ListColumnHelpers

Defined in:
lib/active_scaffold/bridges/country_select/country_select_bridge_helper.rb

Instance Method Summary collapse

Instance Method Details

#active_scaffold_column_country(record, column) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/active_scaffold/bridges/country_select/country_select_bridge_helper.rb', line 15

def active_scaffold_column_country(record, column)
  country_code = record.send(column.name)
  return if country_code.blank?
  country = ISO3166::Country[country_code]
  return country_code unless country
  country.translations[I18n.locale.to_s] || country.name
end