diff --git a/templates/book/author.html.ep b/templates/book/author.html.ep index 93aa1c3..ee62f2e 100644 --- a/templates/book/author.html.ep +++ b/templates/book/author.html.ep @@ -1,5 +1,7 @@ % layout 'default'; % title 'Author: ' . $author->name; -

Author: <%= $author->name %>

+

<%= title %>

-<%= $author->name %> wrote <%= $author->books->count %> books. +<%= $author->name %> +% my $count = $author->books->count; +wrote <%= $count %> book<%= "s" if ($count > 1) %>. diff --git a/templates/book/authors.html.ep b/templates/book/authors.html.ep index f3025e7..bf5b564 100644 --- a/templates/book/authors.html.ep +++ b/templates/book/authors.html.ep @@ -1,6 +1,6 @@ % layout 'default'; % title 'Authors'; -

Author page

+

Authors

<%# On a new search, reset the page number to 1. %> %= form_for authors => { page_number => 1 } => begin @@ -16,11 +16,13 @@
- + + % for my $author ($author_page->all) { - + + % }
NameBooksAuthored by
<%= link_to($author->name => 'author' => { id => $author->id}) %><%= $author->books->count %><%= link_to($author->name => 'author' => { id => $author->id}) %>
diff --git a/templates/book/books.html.ep b/templates/book/books.html.ep index 51bec75..2df30a6 100644 --- a/templates/book/books.html.ep +++ b/templates/book/books.html.ep @@ -1,6 +1,6 @@ % layout 'default'; % title 'Books'; -

Book page

+

Books

<%# On a new search, reset the page number to 1. %> %= form_for books => { page_number => 1 } => begin @@ -21,7 +21,9 @@ % for my $book ($book_page->all) { <%= $book->title %> - <%= $book->author->name %> + + <%= link_to($book->author->name => 'author' => { id => $book->author->id}) %> + % }