Open jackmatt2 opened 9 years ago
@jackmatt2 Thanks, just one question though, as you mentioned in #72 , and as we always do, we put the validations on the controller level,
This solves point 1.
In what scenario you find the need to have different validation rules for the same controller? this sounds like a bad structure to me,
Regarding point 3, ember-validations
is already a dependency of the ember-forms addon.
Thanks
@jackmatt2 Thanks, just one question though, as you mentioned in #72 , and as we always do, we put the validations on the controller level,
This seems to work for Em.ObjectController
, however, it does not work for Em.Controller
. As I understand it, Ember 2.0 is heading toward Em.Controller
and scrapping Em.ObjectController
completely so I would suggest support for it.
In what scenario you find the need to have different validation rules for the same controller? this sounds like a bad structure to me,
Say you had a form to create a new user and you were able to specify the type of user "regular" or "admin". Maybe a regular user can have a password length of 6 characters but an admin user needs 12 characters. The validations would need to change depending on what was selected in the drop down.
Regarding point 3, ember-validations is already a dependency of the ember-forms addon.
Oh, good. Forget my comment about that then.
@jackmatt2 Really? so no Object proxy anymore? sounds weird to me,
Anyway, I understand, I'll try to push this forward on next iteration.
I propose that validations be passed into the form as an attribute and
em-form
include theEmberValidations.Mixin
.This would solve a number of issues:
The downside of the approach is that
Ember-Validations
would become a dependency on the project. I still believe however that most people would want some sort of client side form validations and that this is one of the strengths of ember-forms. If people did not care about validations it is almost as easy to write the code in native emberjs and applying the bootstrap classes thus bypassing emer-forms altogether.