Q:

Reusable part of application

I want to create a sms payment engine and reuse it in several applications. It would be best to be able to just copy/paste one directory, maybe configure some minor stuff and just have it working (with views, controllers, etc.).
What's the best way to do this? Of course I'm not asking about this sms thing but about the way to create an isolated piece of application. It's something like a helper application inside of the major application.

A:

There a three ways to build Rails extensions : plain-old ruby code, Railties and Engines. 
Railties and Engines allow you to interact with the Rails framework during the initialization using hooks and therefore extend Rails. Actually, every major Rails component (ActiveRecord, ActionPack, etc.) is a Railtie.
The main difference between a railtie and a Rails engine is that an engine can define its own configuration, models, controllers and views. In a way, an engine is a Rails application you can deploy in another one. In your case, I guess a Rails Engine  would be the right choice.
Whatever the option you use, you will have to build a gem to distribute your extension and share it across projects.
Here is a gist explaining both the Railtie and Engine concepts
A guide to starting your own rails engine.
Enginex, a command line tool which creates a Rails 3 Engine 

