November 2009
3 posts
Compiling Mustache Views for Mustache.js
I’ve been investigating the usage of Mustache, the dead-simple templating language with the funny name, and one very enticing aspect of Mustache is that it’s so simple it can easily be ported across languages. Mustache.js is a Javascript implementation of Mustache that works based on a simple JSON hash and a string template. Wouldn’t it be awesome if we could use the same Mustache template on the...
Hashie: The Hash Toolkit
One of my earliest gems was Mash, a useful tool for creating mocking objects as a Hash. One of the most common problems people had with Mash was a simple one: it conflicted with another class of the same name in extlib! To address this problem as well as give the project some room to grow, Mash is now part of a new toolkit called Hashie. Hashie is available now via Gemcutter and the source, as...
Rails Quick Tip: Readable Conditional Validation
This is something that many may already use as a best practice, but if not it’s something simple and convenient to add to your repertoire. Sometimes you may have a model that requires additional information if a certain condition is met. For example, I may require a user to add more information about themselves if they wish to be listed publicly, whereas I would not if they do not wish to be...