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 [EMAIL PROTECTED] ]

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             [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]


_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to