[Catalyst] HTML::FormHandler and the Catalyst stash

Jacinta jarich at perltraining.com.au
Wed Jan 16 11:24:47 GMT 2013


On 16/01/13 21:58, Lukas Thiemeier wrote:
>
> Assumed that you are using HTML::FormHandler::Model::DBIC, 
> HTML::FormHandler will store the new (or updated) item in the forms 
> "item" attribute.
>
> You can try this:
>
>  my $new_id = $c->stash->{form}->item->id;
>  $c->res->redirect($c->uri_for($self->action_for('review'), [$new_id]));
>
> This code should work, no matter if the item was updated or created. 
> It will even work if the items id changes during the update process 
> (which should rarely happen, but it will work if it happens)

That's exactly what I'm looking for, thank you!  Is this in the 
documentation somewhere?  I'm very happy to read documentation, when I 
know where to look for it.

All the best,

     Jacinta



More information about the Catalyst mailing list