rubyforgood/babywearing

View on GitHub
app/views/carriers/loans/_checkin_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_with model: @loan, url: carrier_loan_path(@carrier, @loan), method: :put, remote: request.xhr?, html: { data: { modal: true } } do |form| %>
  <div class="modal-body">
    <%= form_errors @loan %>

    <div style="background: #fbf6f4;border: 1px solid #d0cfcf;padding: 10px;">
      <%= tag.h5 "You are checking in", style: "color: #283c46" %>
      <p><em><%= @carrier.name %></em></p>
      <%= render partial: "carriers/details", locals: { carrier: @carrier } %>
    </div>
    <div class="form-group">
      <%= form.label :returned_on %>
      <%= form.date_field :returned_on, { class: "form-control" } %>
    </div>
    <div class="form-group">
      <%= form.label :notes %>
      <%= form.text_area :notes, class: "form-control", rows: 3 %>
    </div>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
    <%= form.submit "Checkin", class: "btn btn-primary" %>
  </div>
<% end %>