Hi all, I''ve been searching for answers in the documentation of Rails, but I cannot figure this one out myself: I have a form which makes use of the form_remote_tag. How can I make use of the default (model) validation scheme? Or do I need to perform the validations manually and provide my form with the proper feedback to show the errors to the user? If anyone knows a good (dry) example of validations together with Ajax forms, please let me know. Kind regards and thanks in advance, Daniel. __________________________________ Yahoo! Mail - PC Magazine Editors'' Choice 2005 http://mail.yahoo.com
On 30-sep-2005, at 14:33, Daniel Palomo van Es wrote:> Hi all, > > I''ve been searching for answers in the documentation > of Rails, but I cannot figure this one out myself: > I have a form which makes use of the form_remote_tag. > How can I make use of the default (model) validation > scheme? Or do I need to perform the validations > manually and provide my form with the proper feedback > to show the errors to the user? > > If anyone knows a good (dry) example of validations > together with Ajax forms, please let me know.You can try to send an error response from your action and acting accrdingly withhin the view. If your entry is valid, then your controller will send a 200 code and the render of the entry, otherwise it will send a 500 code and the re- rendered form (which will contain the values of the record and all error highlighting). -- Julian "Julik" Tarkhanov
It should work fine without anything special.
I am using remote forms heavily along with the model validation.
I believe that the field highlighting does not work, but then again I never
liked that anyway.
Just parse error_messages_for(''whatever'')
bogdan
On 9/30/05, Daniel Palomo van Es
<dpalomovanes-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:>
> Hi all,
>
> I''ve been searching for answers in the documentation
> of Rails, but I cannot figure this one out myself:
> I have a form which makes use of the form_remote_tag.
> How can I make use of the default (model) validation
> scheme? Or do I need to perform the validations
> manually and provide my form with the proper feedback
> to show the errors to the user?
>
> If anyone knows a good (dry) example of validations
> together with Ajax forms, please let me know.
>
>
> Kind regards and thanks in advance,
>
>
> Daniel.
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors'' Choice 2005
> http://mail.yahoo.com
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thank you very much. Kind regards, Daniel Palomo van Es. --- Bogdan Ionescu <bogdan.ionescu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It should work fine without anything special. > I am using remote forms heavily along with the model > validation. > I believe that the field highlighting does not work, > but then again I never > liked that anyway. > Just parse error_messages_for(''whatever'') > > bogdan > > On 9/30/05, Daniel Palomo van Es > <dpalomovanes-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi all, > > > > I''ve been searching for answers in the > documentation > > of Rails, but I cannot figure this one out myself: > > I have a form which makes use of the > form_remote_tag. > > How can I make use of the default (model) > validation > > scheme? Or do I need to perform the validations > > manually and provide my form with the proper > feedback > > to show the errors to the user? > > > > If anyone knows a good (dry) example of > validations > > together with Ajax forms, please let me know. > > > > > > Kind regards and thanks in advance, > > > > > > Daniel. > > > > > > > > __________________________________ > > Yahoo! Mail - PC Magazine Editors'' Choice 2005 > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________ Yahoo! Mail - PC Magazine Editors'' Choice 2005 http://mail.yahoo.com