It can be nice to have this option to lower the load on the server. But
also means that custom validations will have to be translated to
therefore giving double the amount of work (not DRY) for the same
De: [email protected]
[mailto:[email protected]] Em nome de Dave S.
Enviada em: sexta-feira, 11 de novembro de 2005 16:38
Para: [email protected]
Assunto: Re: [Rails] javascipt form validation in Rails
On Thursday 10 Nov 2005 05:57, Peter M. wrote:
In PHP I was validating twice: client side and then server side. Certainly
the code was not DRY but it made the user experience quicker and saved
server requests. I thought of the client side validation as optimization
the application. In “Agile Web D. with Rails” there is no mention
that I can find of purely client side form validation. Is this just not
If people are still doing validation twice like I used to do then I’m
curious how they are handling it. Does it conflict with AJAX in any way?
There’s various schools of thought on this, and while I don’t
speak for “The Rails Way ™” of doing it, I think a specific
made to do it server-side only in Rails.
validation with alert boxes and so on can get rather unwieldy, and since
have to do server-side validation anyway, and since rails makes it so
do the server side validation, and since validating it in two different
is rather un-DRY, I think that’s essentially the reason Rails uses
side validation only.
I may be wrong about this, but I’m pretty sure this was what was said
time this topic cropped up. Someone else please feel free to correct
Having said that, I wouldn’t be surprised if someone makes a plugin to
sometime, since it would probably be quite easy to automatically create
I’m not certain I’m right about all this - just trying to answer your
since nobody else has yet!