Fix a bug in the authors page...

Each author in the table has a link to a page for that particular
author.  The link didn't set the page_number and it turns out in that
case the page number is unchanged.

So if you're on page 5 of authors and follow the link for some author,
you go to /author/<id>/5 which attempts to show page 5 of that
author's books.  If the author doesn't have that many books, the table
is empty.  The fix is to set page_number explicitly to 1.
This commit is contained in:
barnold 2022-09-19 20:20:40 +01:00
parent f2418a1e59
commit a12aae81dc
1 changed files with 4 additions and 1 deletions

View File

@ -20,7 +20,10 @@
% for my $author ($author_page->all) {
<tr>
<td style="text-align:right"><%= $author->books->count %></td>
<td style="padding-left:1em"><%= link_to($author->name => 'author' => { id => $author->id}) %></td>
<td style="padding-left:1em">
<%= link_to($author->name => 'author' =>
{ id => $author->id, page_number => 1}) %>
</td>
</tr>
% }
</table>