[html-formfu] DBIC and has_many documentation clarification

Doug Orleans dougorleans at gmail.com
Tue May 17 00:18:11 GMT 2011

The documentation for implementing a DBIC form for a has_many relation
is wrong (or misleading):


There, it says:

  The general principle is the same as for might_have and has_one
above, except you should use a Repeatable element instead of a Block,
and it needs to contain a Hidden field corresponding to the foreign

But, as I found out after some debugging, the Hidden field actually
needs to correspond to the primary key (of the related table), not the
foreign key.  In the example given, the primary key and the foreign
key are the same (the "book" column), but this seems like a bad
example, since if the "book" column is a primary key in the review
table, that means there can only be one review row per book!


More information about the HTML-FormFu mailing list