Put the about-page under the book controller.

This commit is contained in:
barnold 2022-09-29 13:18:03 +01:00
parent 4c5626c9ef
commit 24fbcf708b
4 changed files with 1 additions and 21 deletions

View File

@ -87,7 +87,7 @@ sub startup ($self) {
# '/' removed.
$r->get('/<page_number:num>')->to('book#books', page_number => 1)->name('home');
$r->get('/<page_number:num>')->to('book#books')->name('books');
$r->get('/about')->to('home#about');
$r->get('/about')->to('book#about');
$r->get('/authors/<page_number:num>')->to('book#authors')->name('authors');
$r->get('/author/<id:num>/<page_number:num>')->to('book#author')->name('author');
$r->post('/set_rpp')->to('book#set_rpp')->name('set_rpp');

View File

@ -1,8 +0,0 @@
package MyApp::Controller::Home;
use Mojo::Base 'Mojolicious::Controller', -signatures;
# No need for a method for either 'index' or 'about'.
# sub index ($self) {
# }
1;

View File

@ -1,12 +0,0 @@
% layout 'default';
% title 'Home';
<h1>Home page</h1>
<p>Pages that don't require login:</p>
<p><%= link_to("About" => 'about') %></p>
<p><%= link_to("Books" => 'books' => { page_number => 1 }) %></p>
<p><%= link_to("Authors" => 'authors' => { page_number => 1 }) %></p>
<p>For this, you'll need to log in, then MyApp will redirect you:</p>
<p><%= link_to("Account" => 'account') %></p>