Implementing REST services in Ruby on Rails usually means to follow the steps:
One ends up with a lot of controllers that are similar, but not quite the same. They all mix the REST logic - which is a technical aspect - with business logic. To my experience controller code, which is quite neat at the start, gets overwhelmed by business logic and becomes hard to maintain, because it appears to be easy and quick to do that, instead of refactoring some model code.
Toast is an experiment to separate the technical aspects of the controller (receive a request, decode it, do something with a model, create a response) from the business logic to that extent that coding a specialized controller becomes unnecessary. A widely recommended strategy is to code skinny controllers. For REST they become so skinny and similar that it makes sense to use a generic controller. Whatever there is different can be configured in the model class that is to be served by it. In other words: The model defines it's own controller.
Last edited by robokopp,