From: Brian Adkins Date: 2007-05-02T14:00:09+09:00 Subject: Re: Problem with RoR's controller getting too large On Mon, 30 Apr 2007 06:03:06 -0700, shurain wrote: > Let's assume that there are two models Post and Comment. If we have a > controller dealing with both of these models, it wouldn't take long > before the controller grows too big to maintain. As far as I > understand, this happens because a controller tries to handle all the > actions allowed by the user. If I change the perspective and create a > controller per model the controller getting too large is fixed but I > have another problem. I think you've created a false dichotomy. Have you, perhaps, come under the influence of the REST community? I think it's perfectly fine to have a PostController and CommentController handle the CRUD for their respective models and also create a different controller that interacts with both models and delivers the hybrid view - that's what controllers are for. > > I don't see any good way of accessing multiple controllers (or models) > in one view. There are times when I have to see an instance of a Post > "AND" the comments which belongs to the post. I've heard that it can > be solved by using components but that has been deprecated and I've > heard that there are some issues which discourage its use. Using > application.rb doesn't really help because it still makes the > controller grow large. Is there any clean solution to this?