judgegem / judge

Client-side form validation for Rails
MIT License
256 stars 41 forks source link

Perform validation by default #18

Closed Vadorequest closed 10 years ago

Vadorequest commented 10 years ago

Is there a way to perform the validation by default instead of always validate: true for each field? Basically I want to use it always, and set it to false when I don't need it.

If judge doesn't allow us to do such thing I'll fork the gem, which file should I change? (Basically change a if statement by allowing nil value to perform validation too, not be forced to expect a true)

Thanks!

joecorcoran commented 10 years ago

Nope, no way of doing this. I'd rather keep Judge opt-in on the client side to avoid confusion.

Vadorequest commented 10 years ago

In this case maybe define an option in the initializer to define if we prefer to do it by default or explicitely?

joecorcoran commented 10 years ago

A config option might work, yeah. Will leave this ticket open while thinking about it more.

Vadorequest commented 10 years ago

Do you see others options that we could add to custom the usage of judge?

Maybe the value used by the route? About the uniqueness validation. Instead of having it at two different place, configure it at once used by both client and server sides. I don't see anything more to configure in judge yet.

Vadorequest commented 10 years ago

Did you think more about it?