1 May 2007 03:56
Re: Problem with RoR's controller getting too large
Giles Bowkett <gilesb <at> gmail.com>
2007-05-01 01:56:04 GMT
2007-05-01 01:56:04 GMT
I share Vlad's frustration and generally agree that Rails questions should go to the Rails list. Just for the heck of it, though, there are a couple interesting Rails-world blogs addressing this problem: http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model http://blog.jayfields.com/2007/03/rails-presenter-pattern.html http://blog.jayfields.com/2006/09/rails-model-view-controller-presenter.html http://www.therailsway.com For what it's worth. On 4/30/07, Vlad GALU <dudu <at> dudu.ro> wrote: > On 4/30/07, shurain <shurain <at> gmail.com> 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 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? > > > I don't want to sound rude, but why don't you ask this on the RoR > mailinglist? I'm sure they know more on this matter than the people > that simply use Ruby for other tasks. > > > -- > If it's there, and you can see it, it's real. > If it's not there, and you can see it, it's virtual. > If it's there, and you can't see it, it's transparent. > If it's not there, and you can't see it, you erased it. > > -- -- Giles Bowkett http://www.gilesgoatboy.org http://gilesbowkett.blogspot.com http://giles.tumblr.com/
RSS Feed