RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: mark-d-holmberg
Site: http://www.markholmberg.com
Thank you!
Simple Form needs to submit the name of the zone, not the default to_s value. To do that, try the following in the form:
to_s
= f.input :time_zone, collection: ActiveSupport::TimeZone.us_zones.map { |zone| [zone.name, zone.name] }, selected: @company.time_zone.nil? ? Time.zone : @company.time_zone
In the model I only validate against US time zones in the following fashion:
validates :time_zone, inclusion: { in: ActiveSupport::TimeZone.us_zones.map(&:name) }
See: https://github.com/mark-d-holmberg/sed/tree/master/app/models
THANK YOU! I wrote my college Software Engineering project using the old version of this video, and this new approach makes it so much simpler! Keep them coming.
If you use bootstrap-sass gem, does it have the same generators and what not as the twitter-bootstrap-rails gem?
Thank you! I was so confused at that.
Thank you!
Simple Form needs to submit the name of the zone, not the default
to_s
value. To do that, try the following in the form:In the model I only validate against US time zones in the following fashion:
See: https://github.com/mark-d-holmberg/sed/tree/master/app/models
THANK YOU! I wrote my college Software Engineering project using the old version of this video, and this new approach makes it so much simpler! Keep them coming.
If you use bootstrap-sass gem, does it have the same generators and what not as the twitter-bootstrap-rails gem?
Thank you! I was so confused at that.