-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation/support for 422 field level validation errors #8
Comments
@zyllorion did you find a solution to this? I am getting the same issue as you. |
@petermumford I've actually removed any dependency on this npm for this and ie8 reasons. I wrote my own components in the end. |
Sorry for missing this guys - Was not subscribed to the issues. I'll be addressing this as soon as possible and have turned on notifications! |
@Emerson To get this working for me I changed the
Originally the code was looking for an array and I was passing in an object, hence the strange output. So now I'm simply checking if the object is an array. |
Really appreciate the feedback and code. I've gone ahead and added this (and another error case) to core and it's available as an update through NPM now. Let me know if you try to update - I recently upgraded the project to use Ember-CLI latest, which moved to HTML bars. Thanks again! |
Looks great. Thank you. |
Ember Canary
Ember Data beta 15
I retrieve errors back from the server in what seems to be the recommended way:
... along with an implementation for
RESTAdapter.ajaxError
from http://alexspeller.com/server-side-validations-with-ember-data-and-ds-errors/ which populates the records errors object. In inspector for the record that's put, $E.get('errors.content') returns an array of 4 error objects with an attribute and message for each.My template has something like:
This example doesn't work, but model.myModel.errors.theField does (however it displays [object Object] as the error). In the example above there would be two errors for one of the fields, held as two separate objects in the errors.content.
Not sure if you have a different implementation for errors or I'm just addressing it incorrectly within the template?
I'll reference emberjs/data#2028 because it has related information.
Also http://emberjs.jsbin.com/sidarufuco/1/edit?html,css,js,output as an example that shows multiple errors.
Hope that's enough information!
Thanks
The text was updated successfully, but these errors were encountered: