in 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.我该怎么做?
由于
答案 0 :(得分:1)
我猜是
= select_year Date.new(2020), {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year"}