[html-formfu] many-to-many with a map table and HTML::FormFu::Model::DBIC

Carl Franks fireartist at gmail.com
Thu Nov 19 13:31:13 GMT 2009


2009/11/18 Justin W <scsys.co.uk at datademons.com>:
> Hi,
>
> I'm wondering if FormFu's magic can handle my situation or if I have to
> write custom code.
>
> I have 3 tables.
>
> users
> roles
> user_role_map
>
> I want to creat an admin page where someone can add/change roles on a user
> using a checkboxgroup.
>
> The checkboxes would need to show all of the roles, and by default be
> checked
> or unchecked based on what's in user_role_map.  I thought the many_to_many
> documentation on HTML::FormFu::Model::DBIC would do what I wanted, but it
> only
> seems to get me halfway there (which may very well be entirely my own
> fault.)

It should be as simple as naming the Checkboxgroup after the
many-to-many relationship.

If that doesn't work, can you post your schema code and form config?

Oh, and what part isn't working: default_values() or update() ?

Cheers,
Carl



More information about the HTML-FormFu mailing list