Restful rails: when simple just isn't enough

Could you not just pass these “methods” during a post update? These ‘methods’ really sound like state information about the object that need to be updated. It sounds overkill and redundant to add specialized methods for performing simple state updates.

If you want to display or filter the displayed result by certain state information you can pass them as parameters to either the index function , etc. Alternatively if you wish you could create a custom :member function in the routes when you wish to perform very selective filtering. Ie. recent 45 days of articles, etc.

Rest works well in some cases but possibly not in every case. If its causing you more grief than its worth than don’t bother. I’ve started developing a ‘rest’ app and I must admit that it does simplify my life and removes a lot of the redundant code/views.


Not only could he, but that's what he SHOULD do. He's simply updating the attributes of a resource, which is what HTTP PUT is for.


Your collection methods are fine - think of collection actions as alternative GET requests. This is still the R part of CRUD. You may want to consider using query string parameters instead though.

For your update methods - these could all be part of a single update operation.