Separate date and time form fields in Rails

后端 未结 5 655
轮回少年
轮回少年 2020-12-23 16:43

I have an ActiveRecord model Eventwith a datetime column starts_at. I would like to present a form, where date and time for starts_at

5条回答
  •  礼貌的吻别
    2020-12-23 17:10

    Is this because of a design issue? It is really much easier if you just save starts_at as a datetime data type and use something like:

    http://puna.net.nz/timepicker.htm#

    It simply runs on top of whatever date fields you have for your model.

提交回复
热议问题