RailsCasts Pro episodes are now free!

Learn more or hide this

Clifton Labrum's Profile

GitHub User: cliftonite

Site: http://labrum.co

Comments by Clifton Labrum

Avatar

Never mind. Got it to work. I was passing the wrong data into the validation.

Avatar

I'm using the code introduced in this tutorial, and validation of the time_zone field fails with the error: Time zone is not included in the list.

ruby
#--- View ---
f.label :time_zone
f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones

#--- Model ---
validates_inclusion_of :time_zone, in: ActiveSupport::TimeZone.zones_map(&:name)

Has anyone else encountered this?