1

在haml我有这个:

= label_tag :card_month, "Card Expiration"
= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year",}

我想将选择年份的默认值设置为 2020。我该怎么做?

谢谢

4

1 回答 1

1

我猜

= select_year Date.new(2020), {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year"}
于 2013-07-19T22:47:22.670 回答