开发者

Rails: Don't save date if it wasn't changed

I have a class wi开发者_运维问答th a date. If the user doesn't change it in the view, Rails saves today's date (the default values in the drop downs). I would like it to be saved as a null value instead. How do I do this?


You can use :include_blank in your date_select helper. Reference: http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002264

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜