Skip to content

Instantly share code, notes, and snippets.

@petros
Created December 21, 2010 11:28
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 petros/749818 to your computer and use it in GitHub Desktop.
Save petros/749818 to your computer and use it in GitHub Desktop.
Credit card fields (Formtastic)
<% f.inputs :name => "Payment" do %>
<%= f.input :first_name %>
<%= f.input :last_name %>
<%= f.input :card_type, :label => :card_type, :collection => [["Visa", "visa"], ["MasterCard", "master"], ["Discover", "discover"], ["American Express", "american_express"]] %>
<%= f.input :card_number %>
<%= f.input :card_verification, :label => 'Card Verification Value (CVV)' %>
<%= f.input :card_expires_on, :discard_day => true, :start_year => Date.today.year, :end_year => (Date.today.year+10), :add_month_numbers => true %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment