Skip to content

Instantly share code, notes, and snippets.

@mikesabat
Created December 14, 2013 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesabat/7964824 to your computer and use it in GitHub Desktop.
Save mikesabat/7964824 to your computer and use it in GitHub Desktop.
#At the top of the form
<%= f.hidden_field :stripe_card_token %>
#right above the submit button
<% if @user.stripe_card_token.present? %>
Credit Card is on File
<% else %>
<div class='form-group'>
<%= label_tag :card_number, "Credit Card Number" %>
<%= text_field_tag :card_number, nil, name: nil, class: 'form-control' %>
</div>
<div class='form-group'>
<%= label_tag :card_code, "Security Code on Card (CVV)" %>
<%= text_field_tag :card_code, nil, name: nil %>
<%= label_tag :card_month, "Card Expiration" %>
<%= select_month nil, {add_month_numbers: true}, {name: nil, id: "card_month"} %>
<%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, id: "card_year"} %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment