I recently decided it was time to refactor some messy controllers and ended up coming up with a way of quickly breaking up some of the logic in our update actions. By supplying a parameter as part of the PUT request a custom update method can be used.
That way a basic update, which probably just calls update_attributes will always be the default. But you can use custom redirects, render different partials and so on, which does come in handy when you’re doing a lot of asynchronous requests via Javascript.
Wow, that was one hell of a sentence! The module gets included in to a controller and then you PUT an update_handler as part of your request.