This is my code:
<table class="video_table">
<% count = 0 %>
<tr>
<% @f_videos.each do |f_video| %>
<td><%= f_video.name %></td>
<td><%= f_video.date_added %></td>
<td><%= f_video.views %></td>
<% count +=1 %>
<% if count == 4 %>
</tr>
<% end %>
<% end %>
</table>
at each 4 videos placed I want the table to switch row. So I implemented a counter. But it is not working. Any ideas?
4once, since you don't reset it. Generally this type of task is done with the%(modulo) operator so it doesn't have to be reset.