# Retrieve all of the book records as book model objects and store in the
# stash where they can be accessed by the TT template
- # $c->stash->{books} = [$c->model('DB::Book')->all];
+ # $c->stash(books => [$c->model('DB::Book')->all]);
# But, for now, use this code until we create the model later
- $c->stash->{books} = '';
+ $c->stash(books => '');
# 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
# Retrieve all of the book records as book model objects and store
# in the stash where they can be accessed by the TT template
- $c->stash->{books} = [$c->model('DB::Book')->all];
+ $c->stash(books => [$c->model('DB::Book')->all]);
# 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
# Retrieve all of the book records as book model objects and store in the
# stash where they can be accessed by the TT template
- $c->stash->{books} = [$c->model('DB::Book')->all];
+ $c->stash(books => [$c->model('DB::Book')->all]);
# 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
later in the tutorial, you should remove the comment from the
statement in C<sub list> in C<lib/MyApp/Controller/Books.pm>:
- $c->stash->{template} = 'books/list.tt2';
+ $c->stash(template => 'books/list.tt2');
Then delete the C<TEMPLATE_EXTENSION> line in
C<lib/MyApp/View/TT.pm>.