Dave, I mostly second your advice here, but there are a couple of things
that I disagree with.
any *more* logic than this in the view is
inappropriate, but I think testing the value of a simple method call in
the view is OK.
Fair enough. One needn't be a purist. I was just trying to point the
OP to the right path, even if he can stray from it.
IMHO using something like:
@activated_msg = 'This is active' if @my_object.active?
in the controller, and then using @activated_msg in the view, would be
Probably not. I tend to believe that it's a mistake to put display text
in the controller in most cases.
Hmmmm. Now that I think about that, you're probably right, it would
more properly belong in the view. But before making a habit of it,
I'd like to give it some more thought. What arguments (other than MVC
purity) can you (or anyone else) come up with for either side? On the
controller-side, it means fewer decisions being made in the view, but
IMHO that's a pretty weak argument.
If it were any more complicated than
this, though, I'd set a flag in the model or controller so that a simple
boolean value could be tested in the view.
Yes, that's sort of the main point I was getting at before. Looking
at the object's activation state, goes in the controller. Passing in
a simple @object_active? boolean, though, could be perfectly fair game
for the view.
I don't know that I'd agree. Haml (not HAML!) works basically like HTML
(and therefore ERb [not ERB!]) with less typing. I see no particular
reason to use ERb when Haml is available.
Use, perhaps not. Be familiar with, yes, so he can read a lot more
examples. Sorry about the "CaseS BeIng WRoNG", I'm still somewhat of
a RubyNuby myself, so some of these things aren't quite in my fingers'
muscle memory yet!
The problem is that every MVC framework has a different
interpretation of what MVC is.
Ah, well, that's the great thing about standards, innit? So many to
And no longer mine. ESR does explain -- mostly -- how to ask smart
questions, but spends IMHO far too much time saying "look, we don't care
about being nice or helpful. Don't expect civility or help when you ask
questions. Just fuck off and hope the gurus throw you a bone." That's
not how I want the communities I'm part of to work.
That's just esr being esr. I s'pose it comes off that way to people
not used to him. If you can get past that stuff, and follow the basic
advice, it's quite useful. I paraphrased it in a blog post once as:
* Try to solve it yourself first. The essay details several
information sources to try.
* Ask the right person or group.
* Communicate well, including:
o Use correct grammar, spelling, punctuation, etc.; don't
m4Ke 7h33 07h4R P3r51n 5p3Nd 4 !07 uv h1z 7yM3 f!9uR1nG oU7 wU7 u
o Get to the point. Preferably as early as the Subject line,
if asking by email.
o Be specific about the problem or question, and what kind
of help you're looking for.
o Give all the data you have.
o But still be concise.
* Say what you already tried, and why that didn't satisfy you.
* Above all, be nice about it! Don't assume that any problem
you're having, is his fault, or even not yours. Don't expect an
instant solution on a silver platter. You're probably not paying the
person who's helping, so be grateful that they're putting forth any
effort at all for you.
(Currently at http://dare2xl.braveblog.com/ and eventually to be moved