Growstuff/growstuff

View on GitHub
app/views/harvests/_thumbnail.html.haml

Summary

Maintainability
Test Coverage
- cache harvest do
  .card.harvest-thumbnail
    = link_to harvest_path(slug: harvest.slug) do
      = image_tag(harvest.thumbnail_url ? harvest.thumbnail_url : placeholder_image,
                            alt: harvest.crop_name,
                            class: 'img img-card')

    .card-body
      %h3.harvest-crop.card-title
        = link_to harvest.crop_name, harvest_path(slug: harvest.slug)
        harvest
      %h4.harvest-plant-part
        = harvest.plant_part_name
        %small.text-muted= harvest.harvested_at