I am trying to filter and returning only the time zones from a specific country.
At now, i tried the without success:
# wrong code - i used Brazil only for tests.
validates_inclusion_of :time_zone, in: ActiveSupport::TimeZone.zones_map(&:name)
= f.input :time_zone, collection: TZInfo::Timezone.all.find_all{ |z| z.name =~ /Brazil/ }
# Return: [#<TZInfo::TimezoneProxy: Brazil/Acre>, #<TZInfo::TimezoneProxy: Brazil/DeNoronha>, #<TZInfo::TimezoneProxy: Brazil/East>, #<TZInfo::TimezoneProxy: Brazil/West>]
It will fail at validation, because the differences TimeZone types, then i tried this conversion How to convert TZInfo to Rails Timezone but this doesn't work too, there are differences at MAPPING vectors.