How often does the letter s occur in:
I tried to create a new record in a route using createRecord method and I persisted it using .save() method.
it is getting saved in db and showing record in my view component.
but I am generating id on my db. but when i check id is showing as null.
I think the model is not refreshing automatically on creating new record.
when I manually refresh page the record is showing with id
What data does your API return? It sounds like Ember isnt able to extract the ID from the API response.
I am getting response from db with id. but it is not automatically refreshing store
I am sure you are getting a response but unless it is in the exact form ember expects then it will not automatically extract the ID and update the store. Take a look into the normalizeResponse, specifically normalizeSaveResponse which is the hook you can use after saving a record.
but when I refresh the page the record is updating with id.
So I think the problem is data store is not automatically updating on creating new record.
But it is updating on refreshing page. I found this difference using ember inspector in chrome and I had a watch on ember data in ember inspector
And I have a doubt will ember data get refreshed automatically on creating new record . ie, will it display the get response from db automatically??
were you ever able to find an answer to this? I am having the same issue, but no luck. Ive seen alot of questions like this from several years back, which included workarounds, but none of the workarounds really worked for me. Basically, i only get back the data that i included in the CreateRecord part, but not the id that came from the server.
Having the same issue. @rpcollins were you ever able to solve this?
user
In that passage, there are eighty-one occurrences of the letter "s."
assistant