De-hardcode the book count.
This commit is contained in:
parent
2dcbf93505
commit
179be1f700
|
@ -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) {
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
Thanks to <a href="https://www.gutenberg.org/">Project
|
||||
Gutenberg</a>, 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.
|
||||
</p>
|
||||
|
||||
|
|
Loading…
Reference in New Issue