Reputation:
I use the following Stripe form
<% 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 %>
I wish to change the select_month
input in a way that when it renders to show only months numbers and not months names.
Right now it renders like that:
Any clues? Thank you.
Upvotes: 0
Views: 97
Reputation: 13181
As per the doc http://apidock.com/rails/ActionView/Helpers/DateHelper/select_month
Remove the options add_month_numbers: true
and replace it by use_month_numbers: true
Upvotes: 2