okay, answering my own question after again reading through: https://metacpan.org/pod/HTML::FormFu::Model::DBIC <https://metacpan.org/pod/HTML::FormFu::Model::DBIC#Config-options-for-options_from_model>
The code below works get '/add-client' => sub { my $form = HTML::FormFu->new; $form->load_config_file("forms/addclient.yml"); $form->model('DBIC'); $form->stash( schema => $schema ); $form->process; template 'add-client' => { 'myform' => $form }; }; The addcountry.yml part where the element shows up is: - type: Block tag: tr attributes: id: country_id elements: - type: Block tag: td content_xml: "Land-code *" attributes: class: label - type: Block tag: td elements: type: Select name: "country_id" model_config: resultset: Country label_column: "country" > On Oct 1, 2018, at 13:43PM, Gert van Oss <gertl...@mac.com> wrote: > > hello, > > I’m using HTML::FormFu to generate forms for a small Dancer2 application. > Creating the forms all works fine. While trying to experiment with > HTML::FormFu::Model::DBIC I got lost. > > With the code shown below the form is generated but the select element > doesn’t show any values. Have I missed something? > > Best regards, > Gert > > > The route in the Dancer2 App is: > > ———— > get '/add-client' => sub { > my $form = HTML::FormFu->new; > $form->model('DBIC'); > $form->stash( schema => $schema ); > my $data = LoadFile('forms/addcountry.yml'); > $form->populate($data); > template 'add-country' => { 'myform' => $form }; > }; > ———— > > The addcountry.yml part where the element shows up is: > > ———— > - type: Block > tag: tr > attributes: > id: country_id > elements: > - type: Block > tag: td > content_xml: "Land-code *" > attributes: > class: label > - type: Block > tag: td > elements: > type: Select > name: "country_id" > model_config: > resultset: Country > ———— > > > > > _______________________________________________ > HTML-FormFu mailing list > HTML-FormFu@lists.scsys.co.uk > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
_______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu