Search code examples
ajaxperldancer

Which form-builder handles many-to-many relationships of data and dynamic input?


I'm experimenting with Dancer some time, and looking for the right blocks to build my application. Frameworks tend to have flat example applications, dealing with one table at time. So I have no good idea which tools should be used to build a little bit more complex CRUD forms.

Let's say I create a Booklovers app. It should have a form to add/edit books with authors. To cover this I need 3 tables in our database: books, authors and books_to_authors. Which is best way to build a form to add a book with authors?

Note:

  • It is not known how many authors a book may have, we need dynamic adding of rows.
  • The authors table may have tens of thousands of records, so a select form element is not suitable.
  • An author may be missing from our database, we need to add them dynamically, too.

All these dynamic parts needs some AJAX. Is there a good solution to integrate it with form creating tools in Perl? I looked at CGI::FormBuilder and am still looking, but I did not find something that could build forms for 3 joined tables as described. The dynamic client-side part also still needs to be covered.

Are there some best practices for such a pretty simple case?


Solution

  • Seems it is somehow too complex question to have straightforward solution.

    I stick using templates forms and generete dynamic part with different jQuery plugins.

    I don't think it is best way, but have not seen better for now.