indexiatech / ember-forms

Smart, Intuitive forms for Ember.js styled with Bootstrap, Multi layouts and Validation support.
http://indexiatech.github.io/ember-forms
Apache License 2.0
218 stars 45 forks source link

5 Minute example extend missing #65

Open wwwdata opened 9 years ago

wwwdata commented 9 years ago

Hi, I didn't know how to directly do a pull request to change the documentation on your github page, so I opened an issue here.

In the 5 minute example: http://indexiatech.github.io/ember-forms/quickexample Validations are used here but it was forgotton to extend the Model from the Validations Mixin of ember-validate.

The correct code example must look like this:

MyController = Em.Controller.extend Ember.Validations.Mixin,
  genderOptions: [
    {id: 'M', name: 'Male'}
    {id: 'F', name: 'Female'}
    {id: 'O', name: 'Other'}
  ]
  actions:
    submit:
      alert "Submitted!"

of if you use ember-cli, with an import like this:

`import EmberValidations from 'ember-validations'`
MyController = Em.Controller.extend EmberValidations.Mixin,
  genderOptions: [
    {id: 'M', name: 'Male'}
    {id: 'F', name: 'Female'}
    {id: 'O', name: 'Other'}
  ]
  actions:
    submit:
      alert "Submitted!"
asaf commented 9 years ago

Hey, thanks, will update in the upcoming version