Reputation: 4747
In my Rails app, I want single-attribute AJAX updates e.g. "Click on row label in a table to toggle public/private flag". What's the best strategy for implementing this? Use the update
method in controller or a custom method?
Upvotes: 4
Views: 421
Reputation: 34072
Unless you have some compelling reason to use a custom method, just use the normal update, sending your typical object[attr] = value
payload. It's simple, works out of the box, and adheres to REST.
Upvotes: 4