Saving Data Back to the Server
Normally, saving back to the server wouldn’t be terribly interesting, since we could just post a JSON blob that Rails expects to be given to an Active Record’s update method. If you’ll recall, our CustomerDetail class is backed by a materialized view and not a regular table. That means that we can’t call update on it, since you can’t update a materialized view.
That means we’ll have to figure out how to get the data out of our denormalized CustomerDetail and into the right places in the database. But first, let’s get our Angular app and Rails back end set up to receive the data.
Sending Data Back to the Server
First, let’s set up the update action for CustomersController, which is what will receive the payload ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access