Hello all,
I’m working on developing a rather large and complex rails
application. The interface will resemble something like a MDI interface
with 3 “frames” statically located in the browser window. Each of the
frames will have (2-5, fluctuating) tabs that allow for the display of
different information.
I’ve got a significant chunk of it coded and working, but I’m afraid
I’ve coded myself into a corner and am preparing for a possible refactor
of the app’s design (code, not interface). It seemed to me, when I
started, that it made sense for me to create a controller for what
amounts to each tab. That would give me clean code seperation and keep
everything managable. However, I think in retrospect that I may have
toasted my domain model by taking this approach.
I’ve also considered creating a controller for each frame which would
give me 3 controllers, still broken out logically and fairly clean. .
.but I don’t think this really solves my problem.
So, here I am thinking at this point that maybe a single controller is
probably the “correct” way to go with this app. There is only one
layout and is not nor will there be multiple pages (it’s all one page
that runs %100 AJAX). The original problem and reason I’m thinking 1
controller is the way to go is that currently my “application.rhtml”
layout just defines an application window, then my main controller’s
index.rhtml fills in with the (div) definition of the 3 frames which
contain render :partials to populate the actual data for each frame.
There’s obviously a problem when I have to either “southern engineer” or
use render_component to get the stuff from other controllers to render.
With the above being the case, it seems to me as though the “rails
way” is pushing me towards one controller. . but that gets pretty messy
from a code perspective.
So, there’s my situation. I’m humbly asking for advice from some of
you guys that have worked on more complex applications as to the best
way to approach this, or have I missed some other option somewhere?
I’ve just gone back and read the Agile Rails chapters on the Controllers
and ActionViews hoping to get some jewel of wisdom, but it’s focused on
examples that are too trivial to help me out (understandably).
Any advice greatly appreciated. If I need to provide more info, let me
know.
H