Switch to C::P::StatusMessage
hkclark [Thu, 1 Sep 2011 16:17:22 +0000 (12:17 -0400)]
lib/Catalyst/Manual/Tutorial/09_AdvancedCRUD/09_FormHandler.pod

index af1447b..8db2e5f 100644 (file)
@@ -150,9 +150,9 @@ Add the following methods:
         $c->stash( template => 'books/form.tt2', form => $form );
         $form->process( item => $book, params => $c->req->params );
         return unless $form->validated;
-        $c->flash( message => 'Book created' );
-        # Redirect the user back to the list page
-        $c->response->redirect($c->uri_for($self->action_for('list')));
+        # Set a status message for the user & return to books list
+        $c->response->redirect($c->uri_for($self->action_for('list'),
+            {mid => $c->set_status_msg("Book created")}));
     }
 
 These two methods could be combined at this point, but we'll use the 'form'