wkittekat has asked for the wisdom of the Perl Monks concerning the following question:

Trying to copy the AddressBook application from chapter 3 into my ubuntu system.
But with the Catalyst::Controller::Formbuilder I dont see a form in my browser, but an exeption in the debug output:
[debug] Form (person/edit): Looking for config file person/edit.fb [debug] Form (person/edit): Found form config /home/kittekat/catalyst_ +projects/AddressBook/root/forms/person/edit.fb [error] Caught exception in AddressBook::Controller::Person->edit "Can +'t locate object method "form" via package "AddressBook" at /home/kit +tekat/catalyst_projects/AddressBook/script/../lib/AddressBook/Control +ler/Person.pm line 38."
Any idea how to troubleshoot?

Replies are listed 'Best First'.
Re: catalyst book rockway
by jasonk (Parson) on Jan 17, 2008 at 01:07 UTC

    Looks like you forgot to load the FormBuilder plugin, but it's hard to tell without any code.


    We're not surrounded, we're in a target-rich environment!
      I have in the beginning of AddressBook/lib/AddressBook/Controller/Person.pm
      package AddressBook::Controller::Person; use strict; use warnings; use base qw( Catalyst::Controller::FormBuilder Catalyst::Controller::BindLex );
      Isn't that enough?
      do you mind, if I mail the code tar ball (44 kB) of this little Catalyst test application?
Re: catalyst book rockway
by jrockway (Acolyte) on Jan 18, 2008 at 19:46 UTC
    Hi. Change $c->form to $self->formbuilder and form.render to FormBuilder.render (in the TT templates). I keep prodding the publisher to put this in the errata section, but to no avail thusfar.
      Thanks, at least the runtime exception is gone, but instead of the expected form I can see only a header line containing "Edit a person".
      Is it possible to get a working tarball of this application? the publishers web page offers only code snippets in .doc files!!!

      Could you put your up-to-date errata file up on your own site until the publisher gets around to making it available from theirs?

      THANKS for this reply. I got the same error: error Caught exception in AddressBook::Controller::Person->edit "Can't locate object method "form" via package "AddressBook" at ... --- in all cases I replaced: $c->form to $self->formbuilder and form.render to FormBuilder.render (in the TT templates) --- now the chapter-3 example from the Rockway catalyst book is running fine... Ulf.
        Great - I have had a typo in /root/src/person.tt2:
        Formbuilder.render instead of
        FormBuilder.render
        now the FormBuilder does his job!...
      I got the same problem. Thanks for the answer