= form_for @instance, url: {action: "create"}, html: {class: 'form-horizontal', role: 'form', id: 'new-instance-form' } do |f|
  == render 'devise/shared/error_messages'
  .form-group
    = f.label :hostname, class: "col-sm-2 control-label"
    .col-sm-6
      = f.text_field :name, class: "form-control", autofocus: true
  .form-group
      = f.label :plan, class: "col-sm-2 control-label"
      .col-sm-6
        - for plan in @plans
          .radio
            label
              = radio_button_tag 'plan', plan.amount, checked = (plan.id == @plan.id)
              strong = plan.name
              = ": " + plan.metadata['Memory'] + " Memory, "
              = plan.metadata['Processor'] + " Processor, "
              = plan.metadata['Storage'] + " Storage and "
              = plan.metadata['Bandwidth'] + " Bandwidth"
  .form-group
      = f.label :region, class: "col-sm-2 control-label"
      .col-sm-6
        - for region in @regions
          .radio
            label
              = radio_button_tag 'region', region.slug, checked = (region.slug == @region)
              strong = region.name
  .form-group
    .col-sm-offset-2.col-sm-10
      button#checkout.btn.btn-primary type="submit"  New Instance









= form_for @instance, url: new_charge_path, method: "GET", html: {class: 'form-horizontal', role: 'form', id: 'new-instance-form' } do |f|
  == render 'devise/shared/error_messages'
  .form-group
    = f.label :hostname, class: "col-sm-2 control-label"
    .col-sm-6
      = f.text_field :name, class: "form-control", autofocus: true
  .form-group
      = f.label :plan, class: "col-sm-2 control-label"
      .col-sm-6
        - for plan in @plans
          .radio
            label
              = radio_button_tag 'plan', plan.amount, checked = (plan.id == @plan.id)
              strong = plan.name
              = ": " + plan.metadata['Memory'] + " Memory, "
              = plan.metadata['Processor'] + " Processor, "
              = plan.metadata['Storage'] + " Storage and "
              = plan.metadata['Bandwidth'] + " Bandwidth"
  .form-group
      = f.label :region, class: "col-sm-2 control-label"
      .col-sm-6
        - for region in @regions
          .radio
            label
              = radio_button_tag 'region', region.slug, checked = (region.slug == @region)
              strong = region.name
  .form-group
    .col-sm-offset-2.col-sm-10
      / button#checkout.btn.btn-primary type="submit"  New Instance
      = button_to 'Pay now', new_charge_path, class: 'btn btn-lg btn-success', id:'checkout', type: 'submit' 








Change button, its route, jQuery & JS in separate file
Change button, its route, jQuery & JS in separate file

nomadlabs/spacialdb,nomadlabs/spacialdb,nomadlabs/spacialdb