anthonymidili/EasyKeep

View on GitHub
app/views/invoices/_add_services.html.haml

Summary

Maintainability
Test Coverage
.outline
  %h4 Add Services to your Invoice

  = form_tag apply_services_update_invoice_path(@invoice), method: :patch do
    %table
      %thead
        %tr
          %th
          %th Date performed
          %th Memo
          %th Service cost

      %tbody
        %tr
          - @services.by_invoiceable.reverse_order.each do |service|
            - if service.persisted?
              %td= check_box_tag 'service_ids[]', service.id
              %td= service.performed_on.strftime('%Y-%b-%d')
              %td= service.memo
              %td= number_to_currency(service.cost)

    = submit_tag 'Add Checked Services', class: 'tiny button radius'