2009
10.26

Ruby allows instance and class methods to be added to any class through modules.
For example:

A good Example:


has_many :users

has_many adds a lot of new methods to the activerecord objects, but only when we add the ‘has_many’ line in the model.

Some popular examples: acts_as_list acts_as_taggable_on_steroids etc

Here is a Standard recipe for a Mixin like those mentioned above:

No Comment.

Add Your Comment