Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% unless array.blank? %>
- <table class="tablified">
- <tr>
- <th><%= title %></th>
- <th style="width:15%;">actions</th>
- </tr>
- <tr>
- <td colspan="2"><%= link_to("Add new #{array[0].class.to_s.singularize}", { :controller => array[0].class.to_s.tableize, :action => "new" }, { :class => "new_link"}) %></td>
- </tr>
- <% for item in array %>
- <tr>
- <td><%= link_to(eval("item.#{title}"), item) %></td>
- <td>
- <%= link_to("Edit", { :controller => item.class.to_s.tableize, :action => "edit", :id => item.id }) %> or
- <%= link_to("Delete", item, :method => :delete, :confirm => "Are you sure you want to delete this?\n\nThis cannot be undone.") %>
- </td>
- </tr>
- <% end %>
- </table>
- <% else %>
- <% end %>
Add Comment
Please, Sign In to add comment