Advertisement
Guest User

Untitled

a guest
Nov 10th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 1.37 KB | None | 0 0
  1. <% content_for(:header) do %>
  2.     <h1><%= resource_class.model_name.human(count: 2) %></h1>
  3.     <ul class="tabs">
  4.       <li class="active"><%= link_to "Index", "#" %></li>
  5.       <li><%= link_to "New", new_resource_path %> </li>
  6.     </ul>
  7.     <table class='zebra-striped'>
  8.       <thead>
  9.       <tr>
  10.         <% attributes.each do |attr| %>
  11.             <th> <%= resource_class.human_attribute_name(attr) %></th>
  12.             <th> &nbsp;</th>
  13.         <% end %>
  14.       </tr>
  15.      
  16.       </thead>
  17.           <tbody>
  18.             <% collection.each do |resource| %>
  19.               <tr id="<%= "#{resource.class.name.underscore}_#{resource.to_key}" %>" class="<%= "#{resource.class.name.underscore} #{cycle("odd", "even", name: "rows")}" %>">
  20.                   <% attributes.each do |attr| %>
  21.                       <td> <%= resource.public_send(attr).to_s.truncate(20) %> </td>
  22.                       <td class='row-actions'>
  23.                         <%= link_to 'show', resource_path(resource) %>                        
  24.                         <%= link_to 'edit', edit_resource_path(resource) %>                        
  25.                         <%= link_to 'destroy', resource_path(resource), method: :delete, confirm: "Are you sure?" %>
  26.                       </td>
  27.                   <% end %>
  28.                 </tr>
  29.            <% end %>
  30.           </tbody>        
  31.         </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement