|
Revision 223, 0.7 kB
(checked in by jk, 1 year ago)
|
major overhaul of demo project: moved to edge rails, restful controllers, will_paginate for pagination of both content list and search results
|
| Line | |
|---|
| 1 |
<h1>Listing contents</h1> |
|---|
| 2 |
|
|---|
| 3 |
<p><%= will_paginate @contents %></p> |
|---|
| 4 |
<table> |
|---|
| 5 |
<tr> |
|---|
| 6 |
<% for column in Content.content_columns %> |
|---|
| 7 |
<th><%= column.human_name %></th> |
|---|
| 8 |
<% end %> |
|---|
| 9 |
</tr> |
|---|
| 10 |
|
|---|
| 11 |
<% for content in @contents %> |
|---|
| 12 |
<tr> |
|---|
| 13 |
<% for column in Content.content_columns %> |
|---|
| 14 |
<td><%=h content.send(column.name) %></td> |
|---|
| 15 |
<% end %> |
|---|
| 16 |
<td><%= link_to 'Show', :action => 'show', :id => content %></td> |
|---|
| 17 |
<td><%= link_to 'Edit', :action => 'edit', :id => content %></td> |
|---|
| 18 |
<td><%= link_to 'Destroy', { :action => 'destroy', :id => content }, :confirm => 'Are you sure?' %></td> |
|---|
| 19 |
</tr> |
|---|
| 20 |
<% end %> |
|---|
| 21 |
</table> |
|---|
| 22 |
|
|---|
| 23 |
<p><%= will_paginate @contents %></p> |
|---|
| 24 |
<p><%= link_to 'New content', :action => 'new' %></p> |
|---|