Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.58 KB | None | 0 0
  1. <% unless @projects.empty? %>
  2. <table>
  3.   <% number_of_columns = 5 %>
  4.   <% @projects.each_with_index do |project, project_index| %>
  5.  
  6.     <% if (project_index == 0)%>
  7.       <tr>
  8.     <% end %>
  9.     <% if (project_index % number_of_columns == 0) %>
  10.       </tr>
  11.       <tr>
  12.     <% end %>
  13.    
  14.     <td>
  15.       <%= link_to image_tag(project.icon.url(:thumbnail), :class => "project_icon"), {:action => :show, :id => project}, :class => "invisible_link" -%><br/>
  16.        <%= link_to project.name.downcase, {:action => :show, :id => project} -%><br/>
  17.     </td>
  18.   <% end %>
  19. </table>
  20. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement