Rails app config.time_zone not applying when populating form fields for '/edit' view

前端 未结 3 715
后悔当初
后悔当初 2021-01-03 02:17

I specified config.time_zone in my Rails app, but the retrieved times in form fields still render as the UTC (which creates problems on updates). Shouldn\'t this be convert

3条回答
  •  既然无缘
    2021-01-03 02:41

    Just use this:

      
    <%= f.label :time_start %>
    <%= f.datetime_select :time_start, :class => "datetimefield" %>

    I create a little app for this and it's works.

提交回复
热议问题