My idea is to create the form labels from the database's column
comments using the column_to_label feature of RDG. The problem I'm
coming up against is that to get the comment out of the database, I
need to specify the table the column belongs to, and the
column_to_label code gets as an argument the name of the column, but
not the column object itself. I'm not seeing a way to get a reference
to a column's table from within the code that I pass as the
column_to_label parameter to RDG::new.
So my most specific question is how do I get the table name from
within the column_to_label code?
My less specific questions whether there is a better way to display
each database field's comment next to the HTML form field that
represent it?
And my most general question is whether using database comments is
even the best way to provide website users with detailed field
descriptions? It seems like the best way to me since it makes the
database self-documenting. I see it's not standard SQL, but I'm not
planning on ever using a database other than Postgres for this
website.
Thanks!
Adam Mackler
On Jan 31, 11:50 pm, mackler <adammack...@gmail.com> wrote:
> Here's my situation: I'm using Rose::DBx::Garden to create HTML forms
> from my PostgreSQL database. I have many tables, and hundreds of
> fields, many with detailed technical specifications of their
> contents. Users accessing the generated Forms need to be able to see
> detailed descriptions of what they're supposed to be putting in the
> form fields.
The best place to put field descriptions is in the RHTMLO Field
description() method, as you've discovered offlist. There is now
support for this in Rose::DBx::Garden 0.17, and corresponding display
support in CatalystX::CRUD::YUI 0.023.
Thanks.