[Nitro] nitro and complex forms?

TRANS transfire at gmail.com
Thu Aug 25 09:06:31 EDT 2005

On 8/24/05, Tim Larson <tim at keow.org> wrote:
> What is the recommended way of creating complex forms
> when using Nitro/Og?  By complex I mean the form contains
> data from multiple tables, some fields editable, some
> not, heavy validation, database-backed list boxes, and
> careful handling of locking and transactions because
> multiple people will be trying to look at and edit
> data potentially at the same time.

You'll want to create some DSL methods to simplify your task. If
they're generic enough they may be of use to Nitro in general. For
instance I can imagine some validation "ann"-type methods.

    valid :a, { |a| a =~ /^@/ }

Sorry if this is a stupid question (still haven't begun working with
Nitro directly) George is it possible to add meta info with #ann? That
would be useful. Say like

  ann :a, :editable => true

As for list boxes, I have some xHTML helpers that build just such
lovely things for you. But I'm REAL busy at the moment. I'll make them
available as soon as I can. Please somene remind me if I don't do
anything on this within the next few weeks.

As for locking and transactions. The first and foremost thing to do is
use an advanced database. PostgreSQL is good for this sort of intense
usage. The easiest way to protect records is to compare changes --if
someone change something since you accessed the record the warn the
user, show the difference, and give an option to overwrite. If you
like to inform the use of the potential of conflict prioir to record
save operation then there may be a way to get more info from the DB
(locks) (not sure as the former always seemed good enough to me), but
if you do and want it non-db dependent you'll have to have shared
process that keeps track of them. A very simple service really. Put a
REST interface on it for good measure. Might be a nice addition to
Nitro too.

( o _  カラチ
 //    trans.
/ \    transfire at gmail.com

More information about the Nitro-general mailing list