[Solved] How to retrive data from database in the form of grid in ruby on rails


your “col-md-3” is missing “, and you have to put the column size inside the loop each, here is your revision that you can try

<div class="row">
  <% unless @fridges.blank? %>
    <% @fridges.each do |fridge| %>
      <div class="col-md-3">
        <div class="card card-cascade narrower">
            <div class="view overlay hm-white-slight">
              <%= image_tag(fridge.image.url(:medium), :alt => "Fridge Item", :class => "img-fluid")%>
                <a>
                    <div class="mask waves-effect waves-light"></div>
                </a>
            </div>
            <div class="card-block text-center">
                <a href class=text-muted>
                    <h5><%= fridge.Amount %></h5>
                </a>
                <h4 class=card-title>
                    <strong>
                       <%= link_to fridge.Name, fridge_path(fridge) %>
                    </strong>
                </h4>
                <div class=card-footer>
                    <span class=left><%= fridge.Amount %></span>
                    <span class=right>
                        <%= truncate(fridge.Quantity) %>
                    </span>
                </div>
            </div>
        </div>
      </div>
    <% end %>
  <% end %>
</div>

0

solved How to retrive data from database in the form of grid in ruby on rails