I am wondering what is the best practice for allowing bulk edit / update in the controller. I really can’t find articles or guides on the subject.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I see that you tagged your question with REST.
To do it RESTfully, you need to think about the collection or the update itself as the resource.
Say you are working with Product objects.
You might PUT to /product_batches/[some identifier], which would call ProductBatchesController#update, but then you are stuck wondering what goes in [some identifier]. You could make ProductBatch a singular resource and then you wouldn’t need an id.
Better might be to POST to /product_bulk_updates, which would call ProductBulkUpdatesController#create
Here’s another thread:
Bulk Collection Manipulation through a REST (RESTful) API