0

嗨,我在我的视图(_form.html.erb)上有这个命令,当我编辑客户端时显示时间很好,但在分钟显示每小时的 60 分钟我只需要显示 0 分钟和 30 分钟小时。

    <div class="field">
       <%= f.label "Hora inicio" %><br />
       <%= f.time_select :hora_inicio, {:ampm => true}%>
    </div>
4

1 回答 1

2

您可以:minute_step作为选项传递给time_select().

f.time_select :hora_inicio, {:minute_step => 30, :ampm => true}

这将为您提供 0 分钟和 30 分钟。

于 2012-12-11T18:00:16.583 回答