SUSE/hackweek

View on GitHub
app/views/users/edit.html.haml

Summary

Maintainability
Test Coverage
- content_for :title do
  Edit
  = @user.name

.row
  .col-md-12
    %h2
      Edit
      = @user.name
    = form_for(@user, html: { class: 'form-horizontal' }) do |f|
      - if @user.errors.any?
        #error_explanation
          %h2
            = pluralize(@user.errors.count, "error")
            prohibited this user from being saved:
          %ul
          - @user.errors.full_messages.each do |msg|
            %li
              = msg
      .form-group
        = f.label(:location, class: 'col-sm-2 control-label')
        .col-sm-10
          = f.text_field(:location, placeholder: "Location", class: 'form-control')
      .form-group
        .col-sm-offset-2.col-sm-10
          .checkbox
            %label
              =f.check_box(:hide_email)
              Hide Email?
      .form-group
        .col-sm-offset-2.col-sm-10
          = f.submit :class => "btn btn-default"