pgc-www/templates/book/books.html.ep

33 lines
653 B
Plaintext

% layout 'default';
% title 'Books';
<h1>Books</h1>
<%# On a new search, reset the page number to 1. %>
%= form_for books => { page_number => 1 } => begin
%= label_for title_like => 'Title like'
%= text_field title_like => flash('title_like')
%= submit_button "Search"
%= end
<p/>
<%= $pager->total_entries %> books found.
<p/>
<div>
<table>
<tr>
<th>Title</th><th>Author</th>
</tr>
% for my $book ($book_page->all) {
<tr>
<td><%= $book->title %></td>
<td>
<%= link_to($book->author->name => 'author' => { id => $book->author->id}) %>
</td>
</tr>
% }
</table>
</div>
%= include '_page-navigation'