Sha256: e387b8292c41853a8ea143013b11ee42339f275de0891e0f45b88451d1fca7bb

Contents?: true

Size: 820 Bytes

Versions: 6

Compression:

Stored size: 820 Bytes

Contents

<%
# Requires resources model_class columns

  cnt = 0
%>

<table class="rows-list">
  <tr>
    <% columns.each do |column| %>
      <th> <%= t("header.#{column}", :default => column) %> </th>
    <% end %>
  </tr>
  <% resources.each do |resource|
       url = "/#{controller_name}/#{resource.id}"
       cnt += 1
  %>
    <tr id="row_<%= resource.id%>" class="<%= %w{odd even}.at(cnt % 2) %>" >
      <% columns.each do |column| %>
	<td> <%= resource_format(resource.send(column)) %> </td>
      <% end %>
      <td>
	<%= link_to t('button.show', :default => 'Show'), url %>
	<%= link_to t('button.edit', :default => 'Edit'), url + '/edit' %>
	<%= link_to t('button.delete', :default => 'Delete'), url,
		:remote => true,
		:confirm => 'Are you sure?', :method => :delete %>
      </td>
    </tr>
  <% end %>
</table>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rows_controller-0.4.4 app/views/rows/_list.html.erb
rows_controller-0.4.3 app/views/rows/_list.html.erb
rows_controller-0.4.2 app/views/rows/_list.html.erb
rows_controller-0.4.1 app/views/rows/_list.html.erb
rows_controller-0.3.2 app/views/rows/_list.html.erb
rows_controller-0.2.4 app/views/rows/_list.html.erb