Adding functionality to an app in modular fashion?

Building a Rails app entails creating files in multiple locations. Config dir, App, Views, Layouts, etc.

If I have an existing application app framework, is there a way to add a new feature (for example, contracts management) where the files

for the new feature are bundled together and not scattered willy-nilly throughout the Rails application directory tree?

Pros? Cons?

Thanks,

Joe

Building a Rails app entails creating files in multiple locations. Config dir, App, Views, Layouts, etc.

If I have an existing application app framework, is there a way to add a new feature (for example, contracts management) where the files

for the new feature are bundled together and not scattered willy-nilly throughout the Rails application directory tree?

Build it as a Rails engine, so that it is its own application but can be included into your new applications.

http://edgeapi.rubyonrails.org/classes/Rails/Engine.html

Pros? Cons?

The pros and cons are only something you can come up with.