I would also like to know the correct way of doing a collection
update. but I, generally, use ajax for check box, so when user clicks
on the yes - no check box I make a put request to update 1 record at a
time.
I don't think you can avoid having an additional method in the
controller -- after all, the code required to update the collection is
going to be different from any of your other actions. But you can
avoid exposing the name of that new method in the URL.
I would try manually defining a new PUT route outside of the existing
resource map:
@flyerhzm: I quite like the idea of updating the owner of the collection in the case that there is one. There certainly was in my case, but it feels weird to PUT from /school/students to /school, for example.
@chrismear: Your additional route seems cleaner than the :collection => {:update_all => :put} but the Wikipedia entry for REST seems to suggest that a PUT to the collection URL should replace the entire collection with another collection so perhaps merely updating some attributes of some of the collection breaks architectural agreement.