代码之家  ›  专栏  ›  技术社区  ›  jpemberthy

如何从datetime\u select helper中排除秒数?

  •  2
  • jpemberthy  · 技术社区  · 16 年前

    使用时如何抑制秒标记的生成 datetime_select 帮手?

    :include_seconds => false (用于 time_select 助手)但它不起作用。

    1 回复  |  直到 16 年前
        1
  •  1
  •   Max Schulze Sohan    15 年前

    您可以覆盖显示为:order的内容,例如:

    <%= f.datetime_select :fieldname, :order => [:month, :day, :year, :hour, :minute] %>
    

    订单的可能选项有[:月、:日、:年、:小时、:分钟、:秒]