Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 date_select 标签的开始日期设置为当前日期?
我知道 start_year() 但我希望年份、月份和日期从我的 html 表单中的当前年份、月份和日期开始。
你可以传递一个:default选项给它
:default
f.date_select :my_date, default: Date.today