# Set the TT template to use. You will almost always want to do this
# in your action methods (action methods respond to user input in
# your controllers).
- $c->stash->{template} = 'books/list.tt2';
+ $c->stash(template => 'books/list.tt2');
}
B<TIP>: See Appendix 1 for tips on removing the leading spaces when
# Set the TT template to use. You will almost always want to do this
# in your action methods (action methods respond to user input in
# your controllers).
- $c->stash->{template} = 'books/list.tt2';
+ $c->stash(template => 'books/list.tt2');
}
B<TIP>: You may see the C<$c-E<gt>model('DB::Book')> un-commented
# Set the TT template to use. You will almost always want to do this
# in your action methods (actions methods respond to user input in
# your controllers).
- #$c->stash->{template} = 'books/list.tt2';
+ #$c->stash(template => 'books/list.tt2');
}
1;
-Then we need to tell the Result Class to to treat this as a ResultSet
-Class. Open C<lib/MyApp/Schema/Result/Book.pm> and add the following
-above the "C<1;>" at the bottom of the file:
-
- #
- # Set ResultSet Class
- #
- __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Book');
-
Then add the following method to the C<lib/MyApp/Controller/Books.pm>:
=head2 list_recent