However I think the docs are a bit lacking, or maybe my first use of it is not one that is intended (first is a static form not based on an object in the database).
Also I can't get css to target the form correctly.. Also I'm not quite sure if it is possible to get C::C::FB to render the form contents without editable fields, like a confirmation page, though it is not a deal-breaker.
Probably rolling my own template would solve some of these issues..
Also thanks for the tip, I didn't realize it isn't really YAML they're using, though they do say "essentially YAML".
Also I found the pod code doesn't work for the simple static form I am making now that does not depend on the database; I think the edit() subroutine is not supposed to be used in this case perhaps. Just display cyclically with view() and then forward to save(). That is, the /edit url makes no form show, while the /view url displays an editable table. Perhaps edit() is meant to only work with a database object i.e. edit book id 5 with /edit/5, like in the CRUD tutorial.
I'll keep at it, but I'm a bit worried that the /view url is showing an editable form. I'd think /view should only display existing data not as an input form at all... but if so then will have to roll my own confirmation page template I suppose. Hmm, maybe I need to make a dummy module to site in the DB directory that holds my DBIx::Class? I didn't make this one using the catalyst_create.pl script, maybe this is the problem?
UPDATE: Successfully made a static form with Catalyst::Controller::FormBuilder. Only required defining fields in edit.fb, creating /view and /save subroutines, and creating templates for /view (which is about 1 line), /save (a for loop with table rows of field.label and field.value), and /error (dupe user name, etc. a stashed message). I think I'll see how this works out for the next stage of my project, too.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||