= simple_form_for collaborator,
                  as: :collaborator, 
                  url: account_collaborators_path,
                  html: {class: 'qae-form', method: :post} do |f|
  .field_with_errors
    - if add_collaborator_interactor.errors.present?    
      - add_collaborator_interactor.errors.each do |error|
        span.error
          = error
    - if collaborator.errors[:base].present?
      - collaborator.errors[:base].each do |error|
        span.error
          = error

  = f.input :email, required: true, input_html: { class: '' }
  = f.input :role, required: true, input_html: { class: '' }, include_blank: false
  = f.submit "Add"
= simple_form_for collaborator,
                  as: :collaborator,
                  url: account_collaborators_path,
                  builder: SimpleForm::AccountFormBuilder,
                  html: {class: 'qae-form', method: :post} do |f|
  .field_with_errors
    - if add_collaborator_interactor.errors.present?
      - add_collaborator_interactor.errors.each do |error|
        span.error
          = error
    - if collaborator.errors[:base].present?
      - collaborator.errors[:base].each do |error|
        span.error
          = error

  fieldset
    h3
      ' Collaborator's full name
    = f.input :title, input_html: { class: 'big small', autocomplete: "off"}
    = f.input :first_name, input_html: { class: 'big medium', autocomplete: "off"}
    = f.input :last_name, input_html: { class: 'big medium', autocomplete: "off"}

  fieldset
    h3
      ' Telephone number
    = f.input :phone_number, input_html: { class: 'big small', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

  fieldset
    h3
      ' Email
  = f.input :email, required: true, input_html: { class: 'big medium', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

  fieldset
    h3
      ' Administrative rights
    = f.input :role, required: true, include_blank: false, input_html: { class: 'big small', autocomplete: "off"}, label_html: { class: 'visuallyhidden' }

  footer
    nav.pagination role="navigation" aria-label="Pagination"
      ul.group
        li.previous.previous-alternate
          = link_to account_collaborators_path, rel: "prev", title: "Navigate back" do
            span class="pagination-label"
              ' Cancel

        li.submit
          = f.submit "Add collaborator", class: "button"

Add extra fields to collaborator
Add extra fields to collaborator

bitzesty/qae,bitzesty/qae,bitzesty/qae,bitzesty/qae