avrj/eventTicketing

View on GitHub
app/views/admin/customers/_edit_form.html.erb

Summary

Maintainability
Test Coverage
<%= simple_form_for(@customer, url: admin_customer_path) do |f| %>
    <%= f.error_notification %>

    <div class="form-inputs">
      <%= f.input :email, placeholder: 'user@domain.com' %>
      <h2 class="sub-header">Change your personal details</h2>
      <%= f.input :firstname %>
      <%= f.input :lastname %>
      <%= f.input :address, placeholder: 'Esimerkkikatu 1 A 12' %>
      <%= f.input :postcode, placeholder: '01800' %>
      <%= f.input :city, placeholder: 'Helsinki' %>
      <%= f.input :phone, placeholder: '+358401234567' %>
      <%= f.input :date_of_birth, prompt: "Select your birth date", :start_year => Date.today.year-100, :end_year => Date.today.year-12, :order => [:day, :month, :year] %>
      <%= f.label :gender %><br/>
      <%= f.collection_radio_buttons :gender, [[:male, 'Male'], [:female, 'Female'], [:not_defined, 'Unknown']], :first, :last %>
      <h2 class="sub-header">Change password</h2>

      <p>Leave these fields blank to keep the current password.</p>
      <%= f.input :password, label: 'New password' %>
      <%= f.input :password_confirmation, label: 'Retype the new password' %>
    </div>

    <div class="form-actions">
      <%= f.button :submit, "Edit Customer", class: "btn btn-primary" %>
    </div>
<% end %>