In Rails, should you be able to update a field using a URL. Is that called RESTful?
For example, should something similar to this work to update workorder.wostatus_id for workorder with id=2?
http://localhost:5000/workorders/2?wostatus_id=4
Thanks!
In the case you've provided that shouldn't work as updates should be performed via a PUT request although if the URL was requested via PUT then it should work.
Remember the idea is that:
GET to access and retrieve dataPUT to update dataPOST to create dataDELETE to remove dataEDIT: Often the actual parameter names can vary depending on the controller implementation so in rails you often find ?workorder[wostatus_id]=4, where it will reference the model name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With