georgebellos/real_estate

View on GitHub
app/views/devise/registrations/edit.html.erb

Summary

Maintainability
Test Coverage
<%= title "Edit Your Account" %>
<div class="row">
  <div class="span7 offset2">
    <div id="form-account">
      <h2>Edit your account</h2>

      <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
        <%= f.error_notification %>
      <div class="form-inputs">
        <%= f.input :name, label: false, placeholder: "Name" %>
        <%= f.input :email, label: false, placeholder: 'Email', :required => true, :autofocus => true %>

        <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
          <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
        <% end %>

        <%= f.input :password, label: false, placeholder: "Password", autocomplete: "off",
                    hint: "leave it blank if you don't want to change it", required: false %>
        <%= f.input :password_confirmation, label: false,
                    placeholder: "Password Confirmation", required: false %>
        <% if f.object.encrypted_password.present? %>
                      <%= f.input :current_password, label: false, placeholder: "Current Password",
                        hint: "we need your current password to confirm your changes", required: true %>
                    <% end %>
      </div>
        <div>
          <%= f.button :submit, "Save Changes", class: "btn btn-large btn-success" %>
        </div>
      <% end %>

        <hr class='small'></hr>
        <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>

        <%= link_to "Back", :back %>
      </div>
    </div>
  </div>