Forum: Ruby on Rails Validation with AJAX; how to DRY validation?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4a551074ddba4460f95d011c47190d0e?d=identicon&s=25 Henrik (Guest)
on 2006-01-13 11:30
What are some good ways of doing validation with AJAX in Rails (with
Prototype/Scriptaculous)? I have some Ajax.InPlaceEditors, and I would
like the page with the editors on it to display errors if the data given
is e.g. too short, too long, wrong format...

Ideally, this should be DRY in regard to the validators.

A related question: is there any way of DRY between the database table
field constraints and validators? That is, can you make your model
automatically pick up on e.g. maxlength based on the table field's
varchar length?
5f3d7eb9e9314f4eb94b4040cee4d8d2?d=identicon&s=25 puzzelv (Guest)
on 2006-05-15 17:39
(Received via mailing list)
Try out this plugin I created....
View this message in context:
Sent from the RubyOnRails Users forum at
8520bd1ba7ef07ee81484fbda8ef4cbb?d=identicon&s=25 Henrik =?iso-8859-1?Q?Orm=E5sen?= (Guest)
on 2006-05-15 18:07
(Received via mailing list)
Made an new rails app, then run the ajax scaffold generator. Since it
worked from here I copied over all files from the public/javascript
folder to my old app, and rerun the ajax scaffold generator here, and
now it works.

- henrik
This topic is locked and can not be replied to.