Markaby on Rails
Anthony has a written a comparison of a few Rails templating options, ending in a compelling recommendation of Markaby. I do find the ”<% %> syntax ugly, and with more and more content generated by helpers there’s a lot to be said for a whole-Ruby option.
On the other hand I would hesitate. With the majority of the community, and especially the core team, using rhtml, and given the rapid pace of change to the framework would put me out on a limb. Tempting, though.

3 Comments:
I really wrote the article to note (and attempt to name) the general phenomenom of this kind of "slim builder" template view. I was hoping someone might point me at some other equally refined examples of the approach e.g. in other languages.
Having said that: yes, I think I would recommend Markaby over ERB. I'm not sure that "not in core" can continue to be a plausible reason in and of itself for avoiding something given the continued ejection of plug-in material from said core. Markaby is fine with Rails 1.2, and I don't think it would be my biggest plug-in maintainence concern if I was living on the Edge - it's a very small piece of code.
(I guess I should perhaps test my intuition by trying to fix up Markaby to work with something edgy such as SimplyHelpful.)
Well maybe. I suppose my hesitation is based on uncertainty. When I leave the mainstream I become uncertain about the source of problems: is it me, or the plugin, or an obscure interaction based on my misunderstanding of the plugin? I might give it a go anyway.
Incidentally, have you looked at Seaside? Is this a Slim Builder?
It's certainly a builder. Slimness is in the eye of the beholder, perhaps, but I think that one is a little verbose.
Smalltalk would let you do the reflective and eigenclassy tricks you'd need to thin it down further, but it might not have sufficient syntax holes to thread all of Markaby's conceits through (e.g. calling a bang method to set an id.)
I should add by the way that ERb renders significantly faster than Markaby - in some alien performance intensive world perhaps that would be another reason to stay tangled.
Post a Comment
<< Home