app/views/shift_activities/index.html.erb

Summary

Maintainability
Test Coverage
<section class="content-header">
</section>
<section class="content">
  <div class="box">
    <div class="box-header">
      <h3 class="box-title">ShiftActivity</h3>
      <div class="box-tools pull-right">
        <div class="btn-group">

          <%= link_to "Add ShiftActivity", new_shift_activity_path, class: "btn btn-primary" %>
        </div>
      </div>
    </div>
    <div class="box-body">
      <div class="">
        <table class="table" id="shift_activities-table" >
          <thead>
            <tr>
              <th>Date </th>
              <th>Amount </th>
              <th>Remarks </th>
              <th>Shift </th>
              <th>Shift Activity Type </th>
              <th> Actions </th>
            </tr>
          </thead>
          <tbody>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</section>

<script>
  $(document).on('turbolinks:load', function() {
    $('#shift_activities-table').dataTable({
      "processing": true,
      "serverSide": true,
      "ajax": $('#shift_activities-table').data('source'),
      "pagingType": "full_numbers",
      "columns": [
        { "data": "date" },
        { "data": "amount" },
        { "data": "remarks" },
        { "data": "shift_id" },
        { "data": "shift_activity_type" },
        { "data": "actions", "sortable": false }
      ]
      // pagingType is optional, if you want full pagination controls.
      // Check dataTables documentation to learn more about
      // available options.
    });
  });
</script>