Friday, January 29, 2010

Awesome Taxonomy module for categorise content in drupal

Taxonomy is pretty cool for creating categories in drupal. You can create multiple categories and sub categories for each node type. These categories are applied to the partucalar nodes as you mention. So the same category set can be set to multiple content types and also each content type have multiple categories lists. See all about taxonomy at

A small Tip

A small tip to call methods dynamically using Ruby's send method.

["foo", "bar"].each do |method|

The above code is same as calling and

Make your rails application DRY with constants

Constants help with consistency, they easily allow you to keep your code DRY.
One of the ways I utitilise constants is to standardise the date formatting I use across an app.
For example, in environment.rb I will create a module to contain my date format constants:

module Dates
DATE_FORMAT = "%d% %b %Y"

The module just groups them nicely together. To use the constants I will write the following:


Remember you will need to restart your server after making any changes to environment.rb