Closed mankind closed 11 years ago
1: For this you could just manually create the model and then merge it into the session: E.g.:
user = App.User.create(...);
session.merge(user);
2: Yup, remoteCall should be used here. You can optionally return models from the action that will be updated on the client.
I am going to close this issue for now, but feel free to keep the questions coming!
1. How to do I add data either into a new epf session or add the data to an existing session after making an AJAX request like the one shown below. Also is that the right way to access a session from the controller. Do I use session.merge or will it be session.load
or do I use this.adapter.load(type, id) as in this.get('session').adapter.load(App.User, data.users) I got that by reading the source code link below:
2. Does the RESTAdapter make calls to custom rails controller actions.
After reading the source here:
It seems that is what the remoteCall method does, but I am correct?
If I am correct, will this be the right way to update the rails controller action to true using remoteCall where the url is tasks/:id/complete. The rails controller code is pasted after the epf code below:
This is the rails controller with an action called complete:
The rails route could look like this or the one underneath:
In the database, complete is a boolean: