From: Tomas Doran Date: Fri, 6 Feb 2009 15:19:34 +0000 (+0000) Subject: Apply manual patch from Del Merritt X-Git-Tag: v5.8005~215 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=aee2748332aed431f3c342d3dc2956c0ceb2b1ea;hp=492f2dd52124a9d2ceda3d50f1dc8ea753672047 Apply manual patch from Del Merritt --- diff --git a/Changes b/Changes index 39f0df5..884be45 100644 --- a/Changes +++ b/Changes @@ -1,8 +1,9 @@ Revision history for Catalyst-Manual 5.7XXX XXX + - Change FormFu tutorial to not use deprecated methods (Del Merritt) - MoreCatalystBasics - Additional clarification about TTSite - (Del Merrit) + (Del Merritt) - Tutorial::Authorization - Corrects the ACL for "/books/delete" - Additional comments (Del Merrit) diff --git a/lib/Catalyst/Manual/Tutorial/AdvancedCRUD/FormFu.pod b/lib/Catalyst/Manual/Tutorial/AdvancedCRUD/FormFu.pod index cf2e49b..80c872c 100644 --- a/lib/Catalyst/Manual/Tutorial/AdvancedCRUD/FormFu.pod +++ b/lib/Catalyst/Manual/Tutorial/AdvancedCRUD/FormFu.pod @@ -152,7 +152,7 @@ following method: # Create a new book my $book = $c->model('DB::Books')->new_result({}); # Save the form data for the book - $form->save_to_model($book); + $form->model->update($book); # Set a status message for the user $c->flash->{status_msg} = 'Book created'; # Return to the books list @@ -485,7 +485,7 @@ bottom: # is shorthand for "$form->submitted && !$form->has_errors" if ($form->submitted_and_valid) { # Save the form data for the book - $form->save_to_model($book); + $form->model->update($book); # Set a status message for the user $c->flash->{status_msg} = 'Book edited'; # Return to the books list @@ -504,7 +504,7 @@ bottom: # Add the authors to it $select->options(\@authors); # Populate the form with existing values from DB - $form->defaults_from_model($book); + $form->model->default_values($book); } # Set the template @@ -533,14 +533,14 @@ we set the error message and return to the book list. =item * If the form has been submitted and passes validation, we skip creating a -new book and just use C<$form-Esave_to_model> to update the existing +new book and just use C<$form-Emodel-Eupdate> to update the existing book. =item * If the form is being displayed for the first time (or has failed validation and it being redisplayed), we use - C<$form-Edefault_from_model> to populate the form with data from the + C<$form-Emodel-Edefault_values> to populate the form with data from the database. =back