[html-formfu] Documentation issue with HTML::FormFu::Model::DBIC

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Thu Oct 2 13:00:57 BST 2008


Hi,

I've found a documentation issue with the svn version of  
HTML::FormFu::Model::DBIC

If you follow the example in the section (for has_many relationships)
and call your delete marker "delete", then
   $form->save_to_model($object);

will call the delete method on each of the has_many objects.... with  
predictable (in hindsight - first I blew away chunks of my test db)  
results!

The documentation chunk is shown below.

[I can commit back a patched version if you give commit privs to nigel.metheringham at gmail.com 
  ]

Cheers
	Nigel.

If you want to provide a L<Checkbox|HTML::FormFu::Element::Checkbox> or
similar field, to allow the user to select whether given rows should be
deleted (or, in the case of C<many_to_many> relationships, unrelated),
set C<< $block->model_config->{delete_if_true} >> to the name of that
field.

     ---
     element:
       - type: Repeatable
         nested_name: authors
         model_config:
           delete_if_true: delete

         elements:
           - type: Hidden
             name: id

           - type: Text
             name: author

           - type: Checkbox
             name: delete

--
[ Nigel Metheringham             Nigel.Metheringham at InTechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]




More information about the HTML-FormFu mailing list