Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% content_for(:header) do %>
- <h1><%= resource_class.model_name.human(count: 2) %></h1>
- <ul class="tabs">
- <li class="active"><%= link_to "Index", "#" %></li>
- <li><%= link_to "New", new_resource_path %> </li>
- </ul>
- <table class='zebra-striped'>
- <thead>
- <tr>
- <% attributes.each do |attr| %>
- <th> <%= resource_class.human_attribute_name(attr) %></th>
- <th> </th>
- <% end %>
- </tr>
- </thead>
- <tbody>
- <% collection.each do |resource| %>
- <tr id="<%= "#{resource.class.name.underscore}_#{resource.to_key}" %>" class="<%= "#{resource.class.name.underscore} #{cycle("odd", "even", name: "rows")}" %>">
- <% attributes.each do |attr| %>
- <td> <%= resource.public_send(attr).to_s.truncate(20) %> </td>
- <td class='row-actions'>
- <%= link_to 'show', resource_path(resource) %>
- <%= link_to 'edit', edit_resource_path(resource) %>
- <%= link_to 'destroy', resource_path(resource), method: :delete, confirm: "Are you sure?" %>
- </td>
- <% end %>
- </tr>
- <% end %>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement