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? -- Posted via http://www.ruby-forum.com/.
Try out this plugin I created.... http://railsrtv.rubyforge.org/ -- View this message in context: http://www.nabble.com/Validation-with-AJAX-how-to-DRY-validation--t909731.html#a4393885 Sent from the RubyOnRails Users forum at Nabble.com.
Henrik Ormåsen
2006-May-15 16:04 UTC
[Rails] Re: Validation with AJAX; how to DRY validation? FIXED!
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
Possibly Parallel Threads
- Realtime Form Validation Plugin Available
- update a second div with Ajax.Updater, when Ajax.InPlaceEditor has just finished to modify another first div
- how to do form field validation using javascript in rubyonrails
- Really easy field validation with Prototype Help
- DRY encoding conversion and onload ajax execution