osu-cascades/ecotone-web

View on GitHub
app/views/soil_samples/index.html.haml

Summary

Maintainability
Test Coverage
- content_for_title('Soil Samples')
- content_for(:subnav) do
  = link_to('Add Sample', new_soil_sample_path, class: 'button primary', title: 'Add a new soil sample', method: 'get')

= paginate @soil_samples

%section
  %table.table.list
    %thead
      %tr
        %th{scope: 'col'} ID
        %th{scope: 'col'} Collection Date
        %th{scope: 'col'} Plot
        %th{scope: 'col'} Collection Method
        %th{scope: 'col'} pH
        %th{scope: 'col'} Temperature
        %th{scope: 'col'} Moisture
        %th{scope: 'col'} N
        %th{scope: 'col'} P
        %th{scope: 'col'} K
    %tbody
      - @soil_samples.each do |sample|
        %tr{:onclick => "location.href='#{url_for(sample)}'"}
          %td= sample.id
          %td= sample.datestamp
          %td= sample.plot
          %td= sample.collection_method
          %td= sample.ph_level
          %td= sample.temperature
          %td= sample.moisture
          %td= nutrient_table_data(sample, 'Nitrogen')
          %td= nutrient_table_data(sample, 'Phosphorus')
          %td= nutrient_table_data(sample, 'Potassium')

= paginate @soil_samples