= simple_nested_form_for user, url: update_payment_details_settings_path, validate: true, turboboost: true, html: { class: 'form-horizontal', id: 'credit_cards' } do |f| = hidden_field_tag :type, :credit_cards = f.link_to_add 'Add Another Card', :credit_cards, class: 'btn btn-default pull-right bt-sm fs10 mr10', :data => { :target => "#credit-card-fields" } .clearfix.pb10 #credit-card-fields.col-sm-10.col-sm-offset-2.col-xs-12.no-margin.no-padding = f.fields_for :credit_cards do |c| .col-sm-8 - if c.object.persisted? = c.object.number - else = c.input :number, label_html: {class: 'col-sm-3 fs10 plr15 pb5 mt-10'}, wrapper: :horizontal_form, input_html: {data: {stripe: :number}}, validate: true = c.input :name, label_html: {class: 'col-sm-3 fs10 plr15 pb5 mt-10'}, wrapper: :horizontal_form, input_html: {data: {stripe: :name}}, validate: true = c.input :exp_month, label_html: {class: 'col-sm-3 fs10 plr15 pb5 mt-10'}, wrapper: :horizontal_form, input_html: {data: {stripe: 'exp-month'}}, validate: true = c.input :exp_year, label_html: {size: 2, class: 'col-sm-3 fs10 plr15 pb5 mt-10'}, wrapper: :horizontal_form, input_html: {data: {stripe: 'exp-year'}}, validate: true = c.input :cvv, label_html: {size: 4, class: 'col-sm-3 fs10 plr15 pb5 mt-10'}, wrapper: :horizontal_form, input_html: {data: {stripe: 'cvv'}}, validate: true = c.input :token, as: :hidden, input_html: {class: 'token'} .col-sm-3 = c.input :base, input: false, label: false = c.link_to_remove 'Remove', class: 'pull-right' .col-sm-1.col-xs-1.pt5 = c.check_box :active, class: 'fontawsome-star active', id: "credit-card-active-#{c.index}" label for="credit-card-active-#{c.index}" - if @redirect_url = hidden_field_tag :redirect_url, @redirect_url - if params[:payment_type].present? = hidden_field_tag :payment_type, params[:payment_type] .col-xs-12.col-sm-6.center.mt10 = f.button :submit, 'Save Details', class: 'btn btn-default fs10' .col-xs-12.col-sm-6.center.mt10 = link_to 'Cancel', '#', data: {dismiss: :modal}, class: 'btn btn-default fs10' .clearfix.pb20