我使用以下条纹表单
<% if @user.stripe_card_token? %>
Credit Card is on File
<% else %>
<div class="col-md-4">
<div class="form-group">
<%= label_tag :card_number, "Credit Card Number" %>
<%= text_field_tag :card_number, nil, name: nil, class: "input-lg form-control" %>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<%= label_tag :card_month, "Card Expiration" %>
<%= select_month nil, {add_month_numbers: true}, {name: nil, id: "card_month", class: "input-lg"} %>
<%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year", class: "input-lg"} %>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<%= label_tag :card_code, "CVV" %>
<%= text_field_tag :card_code, nil, name: nil, class: "input-lg form-control" %>
</div>
</div>
<% end %>
我希望以一种方式更改select_month
输入,当它呈现的时间只显示数月,而不是月份名称。
现在它呈现出来:
任何线索?谢谢。
答案 0 :(得分:2)
根据文档http://apidock.com/rails/ActionView/Helpers/DateHelper/select_month
删除选项add_month_numbers: true
并将其替换为use_month_numbers: true