Add an About page.
This commit is contained in:
parent
a3c8a8ae8e
commit
bce8bbeb1c
|
@ -7,6 +7,7 @@ sub startup ($self) {
|
|||
# route's default name seems to come from '/path' with the leading
|
||||
# '/' removed.
|
||||
$r->get('/')->to('home#index')->name('home');
|
||||
$r->get('/about')->to('home#about');
|
||||
$r->get('/auth')->to('auth#index');
|
||||
$r->post('/login')->to('auth#login');
|
||||
$r->get('/logout')->to('auth#logout');
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package MyApp::Controller::Home;
|
||||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
|
||||
sub index ($self) {
|
||||
}
|
||||
# No need for a method for either 'index' or 'about'.
|
||||
# sub index ($self) {
|
||||
# }
|
||||
|
||||
1;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
% layout 'default';
|
||||
% title 'About';
|
||||
<h1>About</h1>
|
||||
|
||||
All about MyApp.
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
<p>Other pages:</p>
|
||||
|
||||
<p><%= link_to("About" => 'about') %>
|
||||
<p><%= link_to("Books" => 'book') %>
|
||||
<p><%= link_to("Foo" => 'foo') %>
|
||||
<p><%= link_to("temp1" => 'temp1') %>
|
||||
|
|
Loading…
Reference in New Issue