X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F03_MoreCatalystBasics.pod;h=a8e1f31b4f9f661911c4efe7956cc4bab71368cc;hp=e8da3f69c5275a537121213c41675d92a2c86933;hb=f33d1dd71df036c7ed6d8ce4ba78bc283b301f32;hpb=ddfbd8506f744fe1dc407bdaa7a1e9211b2dd1d7 diff --git a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod index e8da3f6..a8e1f31 100644 --- a/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod @@ -303,9 +303,9 @@ and add the following method to the controller: # 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 @@ -699,14 +699,16 @@ run this command: $ perl -MCatalyst::Model::DBIC::Schema -e \ 'print "$Catalyst::Model::DBIC::Schema::VERSION\n"' - 0.39 + 0.4 Please note the '\' above. Depending on your environment, you might be able to cut and paste the text as shown or need to remove the '\' character to that the command is all on a single line. -If you have less than v0.39, you will need to run this command to -install it directly from CPAN: +If you are following along in Debian 5, you should have version 0.40 or +higher (shown above as "0.4" with the tailing zero removed). If you have +less than v0.39, you will need to run this command to install it +directly from CPAN: $ sudo cpan Catalyst::Model::DBIC::Schema @@ -857,7 +859,7 @@ and delete the next 2 lines): # 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 @@ -897,7 +899,7 @@ enter: $ export DBIC_TRACE=1 $ script/myapp_server.pl -r - + This assumes you are using bash as your shell -- adjust accordingly if you are using a different shell (for example, under tcsh, use C). @@ -1282,10 +1284,9 @@ above: { join_type => "LEFT" }, ); - The arguments are similar, but see L for the details. - + Although recent versions of SQLite and L automatically handle the C and C relationships, C relationships currently need to be manually inserted. @@ -1336,7 +1337,7 @@ ANYTHING ABOVE!> comment): Run the Catalyst development server script with the C option (it might still be enabled from earlier in the tutorial, but here is an -alternate way to specify the option just in case): +alternate way to specify the trace option just in case): $ DBIC_TRACE=1 script/myapp_server.pl -r @@ -1345,8 +1346,7 @@ three dynamically created model class (one for each of the Result Classes we created). Then hit the URL L with your browser -and be sure that the book list still displays correctly. You can leave -the development server running for the next step if you wish. +and be sure that the book list still displays correctly. B You will not see the authors yet because the view does not yet use the new relations. Read on to the next section where we update the @@ -1505,8 +1505,8 @@ detailed information on how to extend C in C. One of the nice features of C is that it automatically allows you to add C to the end of any URL for your application and it will force the display of the "exception dump" -screen to the client browser. You can try this out by starting the -development server as before and then point your browser to this URL: +screen to the client browser. You can try this out by pointing +your browser to this URL: http://localhost:3000/books/list?dump_info=1 @@ -1555,7 +1555,7 @@ has changed): # 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 @@ -1564,9 +1564,8 @@ has changed): } -You should now be able to restart the development server as per the -previous section and access the L -as before. +You should now be able to access the L +URL as before. B Please note that if you use the default template technique, you will B be able to use either the C<$c-Eforward> or @@ -1583,14 +1582,13 @@ In order to be able to use C<$c-Eforward> and C<$c-Edetach> later in the tutorial, you should remove the comment from the statement in C in C: - $c->stash->{template} = 'books/list.tt2'; + $c->stash(template => 'books/list.tt2'); Then delete the C line in C. -You should then be able to restart the development server and -access L in the same manner as -with earlier sections. +Check the L URL in your browser. +It should look the same manner as with earlier sections. =head1 AUTHOR