[html-formfu] Use default_values() and update() methods of
H::F::M::DBIC
Carl Franks
fireartist at gmail.com
Fri Nov 7 13:37:26 GMT 2008
2008/11/7 Octavian Rasnita <orasnita at gmail.com>:
> Hello,
>
> I try to use H::F::M::DBIC (because I want to update a related table easier), but I can't even use default_values() and update() methods.
>
> $form->default_values doesn't do anything, while $form->update gives the error "Can't locate object method "update" via package "HTML::FormFu".
>
> $form->model->default_values and $form->model->update work fine though.
>
> Am I doing something wrong, or H::F::M::DBIC is not working yet?
> Please tell me if there is a sample program that uses H::F::M::DBIC methods.
Hmm, I need to fix the documentation!
The correct methods are:
$form->model->default_values;
$form->model->update;
$form->model->create;
Note that $form->default_values() does something else entirely [1]
There are many tests in the HTML-FormFu-Model-DBIC distribution, which
is probably the best place to start.
Carl
[1] http://search.cpan.org/~cfranks/HTML-FormFu-0.03005/lib/HTML/FormFu.pm#default_values
More information about the HTML-FormFu
mailing list