X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FBasicCRUD.pod;fp=lib%2FCatalyst%2FManual%2FTutorial%2FBasicCRUD.pod;h=d6e0952ddcaa5869f2d27a87a48eb3f33b185af9;hb=7d310f12e2caaf8e94e8f7f94e88d46698c77fde;hp=6c8e4308c6d2eece8e37a423c2b814127d7c5a82;hpb=0d348d559a5aaa3f4ee46e4524f3e15788044c1b;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod b/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod index 6c8e430..d6e0952 100644 --- a/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod +++ b/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod @@ -45,7 +45,7 @@ L =item 9 -L +L =back @@ -67,7 +67,7 @@ B: Note that all of the code for this part of the tutorial can be pulled from the Catalyst Subversion repository in one step with the following command: - svn checkout http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Tutorial -r 4611 . + svn co http://dev.catalyst.perl.org/repos/Catalyst/tags/examples/Tutorial/5.7X/BasicCRUD MyApp =head1 FORMLESS SUBMISSION @@ -146,13 +146,19 @@ Edit C and then enter: [% # simple strings (e.g., no variable interpolation). -%] [% META title = 'Book Created' %] - [% # Output information about the record that was added. Note use -%] - [% # of 'first' to only list the first author (if > 1 author). TT -%] - [% # v2.15 has an issue that requires -%] - [% # 'book.authors.list.first.value.last_name' vs. the shorter -%] - [% # 'book.authors.first.last_name' in prior versions. -%] -

Added book '[% book.title %]' - by '[% book.authors.list.first.value.last_name %]' + [% # Output information about the record that was added. First title. -%] +

Added book '[% book.title %]' + + [% # Output the last name of the first author. This is complicated by an -%] + [% # issue in TT 2.15 where blessed hash objects are not handled right. -%] + [% # First, fetch 'book.authors' from the DB once. -%] + [% authors = book.authors %] + [% # Now use IF statements to test if 'authors.first' is "working". If so, -%] + [% # we use it. Otherwise we use a hack that seems to keep TT 2.15 happy. -%] + by '[% authors.first.last_name IF authors.first; + authors.list.first.value.last_name IF ! authors.first %]' + + [% # Output the rating for the book that was added -%] with a rating of [% book.rating %].

[% # Provide a link back to the list page -%] @@ -257,7 +263,7 @@ C, the method created in the section that follows. =head2 Add Method to Process Form Values and Update Database Edit C and add the following method to -save the form information to the databse: +save the form information to the database: =head2 form_create_do @@ -431,7 +437,7 @@ with a list of the six remaining books. Kennedy Clark, C Please report any errors, issues or suggestions to the author. The -most recent version of the Catlayst Tutorial can be found at +most recent version of the Catalyst Tutorial can be found at L. Copyright 2006, Kennedy Clark, under Creative Commons License