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
Get new records from the store #245
Comments
@josepjaume well for now, the only way to refresh records from server is to perform a In a simple senario you should do App.Contact.createRecord({}) and them commit your store, this way your list of contacts in the store will be up to date. |
First of all, thanks for answering so fast! I don't get exactly how should I perform that In my particular scenario, I can't (or at least I think so) do it the standard way. I'm implementing a contact importer that adds new contacts based on the contents of a Maybe returning the new contacts in the response and then passing it to the store's
|
Yep this would work, and I think In your case it is a good way to do it. As for
and it will call
This kind of requests are never cached by ember-data |
I've implemented the solution I proposed and it works, but I can confirm yours work too :D. So, just for the record, those two options work:
I think I will stick with loading the new records because it seems more ember-idiomatic, but it's awesome to know the cache can be so easily overriden. Thanks! |
Can we close this? We do have an issue on reloading/loding more records stuff in #51 |
Absolutely! Sorry about that, I looked through the issues but I couldn't find what I was looking for. Thanks for your help. |
hello, i'm trying this approach $.ajax({url: '/import/csv', data: data, dataType: 'json', success: function(results){ and i'm getting an error can you provide more details of how this works? |
I guess I'm doing something wrong, but I've been looking all allong the documentation and the source code and I can't seem to find the proper way to do this using the
REST
adapter.My scenario is simple: I have loaded all my app's contacts:
Later on, I perform a
POST
to a particular location in my backend, which creates a few more contacts. Since the first request is cached, every action I perform (find
,findAll
, etc.) seems to return results from the cached Array instead of doing the round trip to the server.What's the proper way to update the store with the new records from the backend?
Thanks and amazing work!
The text was updated successfully, but these errors were encountered: