diff --git a/lib/MyApp/Controller/Book.pm b/lib/MyApp/Controller/Book.pm index 6ef1022..bd1859d 100644 --- a/lib/MyApp/Controller/Book.pm +++ b/lib/MyApp/Controller/Book.pm @@ -3,6 +3,11 @@ use Mojo::Base 'Mojolicious::Controller', -signatures; use MyModel::Book; use MyModel::Author; +sub about ($self) { + my $book_count = MyModel::Book->new(rows_per_page => $self->rpp)->count_all; + $self->render(book_count => $book_count); +} + sub books ($self) { my $page_number = $self->accept_posint($self->param('page_number')); if (!defined $page_number) { diff --git a/templates/book/about.html.ep b/templates/book/about.html.ep index 335781f..0988330 100644 --- a/templates/book/about.html.ep +++ b/templates/book/about.html.ep @@ -8,7 +8,8 @@ Thanks to Project Gutenberg, this is a site for looking through the book catalog they generously provide. It's a personal project and is not - affiliated with Project Gutenberg. The site currently offers 51,922 + affiliated with Project Gutenberg. The site currently offers + <%= commify($book_count) %> book records out of 68,670 in the catalog.