I’m fighting the urge to just copy/paste view template code & would like
advice on a better strategy.
Consider this model:
Where the *'d attributes are references to other models. I want to
generate tables listing projects in all of these views:
For #1, I want to show all of the columns of the projects, but for the
others, I want to leave out whichever column is redundant given the
thing I’m "show"ing. So for instance, say /statuses/4 is the ‘active’
status. I want to caption my table “Projects that are currently
Active”, and then show all of the project columns except for status.
Likewise, for funders/2 I want a caption “Projects funded by NCI”, and
to show all columns except for funder.
Optimally, this would all be in a single partial that would morph
depending on the context from which I called it. Is there a way to
write that partial w/out making it a hell-broth of if/then statements?
Or is that just a butt-kicking I’ve got to take?
Group Health Center For Health Studies (Cancer Research Network)
Google Talk: rpardee