How to create a plugin

Have a look here... http://rails-engines.org/

Wes Ratcliff