0
votes

I am creating a simple ember app which will retrieve data from Laravel backend server restfully. I can display edit create and delete these records from ember successfully, however when i do any of the crud operation from ember instead of edit, the template doesnt update itself.

Like when i edit the record from ember, ember tempate displays the edited content in realtime, but when i create a new record or delete the one existing, the ember list displays the old record list.

What should i do to make the app update its model data when any changes happen.

Here is my code:

http://jsbin.com/iSEmONuV/

the code in jsbin is non functional .. i just uploaded in jsbin as it is much easier in jsbin than in stackoverflow.. to paste code.. i am using local server to load data.. ihavent uploaded it in real server yet

1
Usually when you place all of your code in jsbin, you update the js/css links that way the code actually works. - Kingpin2k
but i am using localserver to load data, i havent uploaded in any server yet..so - monk
I understand the pain, but it adds the burden of trying to fix all of those additional issues on the the person answering the question. So instead of someone looking for the specific problem they think everything is broken. - Kingpin2k
BTW a real awesome place to start building it up is emberjs.jsbin.com since it puts the main libraries into the page for you - Kingpin2k

1 Answers

0
votes

The problem is createRecord/deleteRecord in ember model doesn't modify any current collections (Ember Data does). So if you create/delete a record that you believe should live on some collection (hasMany or what not) you'll need to manually add/remove it to/from the collection.