I want to know how to develop an modular app in Ruby on Rails....

Lets take an example. I am developing a project for various hospitals.
In hospitals there are various modules like billing, patient records, employee records etc.etc.

Some clients(hospitals) needs only billing but some hospitals needs all the features.

So, according to their requirements I want to deliver only those needed features. All these features also has to be linked to each other.