Ruby on rails ID display is not correct
< H2 > I tried to recreate the table on the terminal, but the ID showed 4, and I was advised to use each_with_index, but I didn"t know where to put it. < / H2 >related codes
< div class= "container" >
< div class= "row" >
<div class="col-xs-3">
<ul class="list-group">
<li class="list-group-item">
<ul class="list-group">
<li class="list-group-item"></li>
<li class="list-group-item"></li>
<li class="list-group-item"></li>
<li class="list-group-item"></li>
</ul>
</li>
<li class="list-group-item">
<ul class="list-group">
<li class="list-group-item"></li>
<li class="list-group-item"></li>
<li class="list-group-item"></li>
<li class="list-group-item"></li>
</ul>
</li>
</ul>
</div>
<div class="col-xs-9">
<div class="row">
<div class="col-xs-12">
<div class="jumbotron">
<h1><%= @ad[:title] %></h1>
<%= @ad[:des] %>
<a class="btn btn-primary btn-lg" href="-sharp" role="button"><%= @ad[:action_title] %></a>
</div>
</div>
</div>
<div class="row">
<% @products.each do |product| %>
<div class="col-xs-3">
<div class="thumbnail">
<%= image_tag product[:image_url] %>
<div class="caption">
<h3><%= "-sharp{product[:id]}. -sharp{product[:name]}" %></h3>
<%= product[:description] %>
<a href="-sharp" class="btn btn-primary" role="button">Button</a> <a href="-sharp" class="btn btn-default" role="button">Button</a>
</div>
</div>
</div>
<% end %>
</div>
<div class="row">
<div class= "col-xs-12">
<nav aria-label="Page navigation">
<ul class="pagination">
<% if @page > @first_page %>
<li>
<%= link_to root_path(page:(@page-1)) do%>
<span aria-hidden="true"></span>
<% end %>
</li>
<% end %>
<% (@first_page..@last_page).each do |page_number|%>
<li><%= link_to page_number,root_path(page:page_number)%> </li>
<% end %>
<% if @page < @last_page %>
<li>
<%= link_to root_path(page:(@page+1)) do%>
<span aria-hidden="true"></span>
<% end %>
</li>
<% end %>
</ul>
</nav>
</div>
</div>
</div>
< / div >
< / div >
what result do you expect? The error message you actually see is!
what I want is
tablecommand id 234 5.
2018-07-25 2.12.34