pramodtech
pramodtech

Reputation: 6280

Build Gem or Plugin or Engine in rails 3

I wanted to create my own Gem and so I Googled "how to build a rails 3 gem" and I got below results in top 2

guides.rubyonrails.org/plugins.html‎ & edgeguides.rubyonrails.org/engines.html‎

It is plugin & engine. I did more search and came to know that

Rails 3.x is moving away from plugins and to everything being gems - including all the components of Rails.

So I decided to see what is Engine and then did some search and found that

Enginex is included in rails 3.1. There’s no need to use it as a gem anymore on new applications !

This made me more confused. I would like to know whether I should just ignore plugin, engine and just focus on Gem development. Please advise.

Upvotes: 0

Views: 1082

Answers (1)

Pierre-Louis Gottfrois
Pierre-Louis Gottfrois

Reputation: 17631

Enginex is included in rails 3.1. There’s no need to use it as a gem anymore on new applications !

This is just telling you that before rails 3.1, you had to include the enginex gem to create rails engines. This is not true anymore for rails 3.1 and higher.

All your questions are answered here.

Basically, Engines are pretty much like Rails applications. In fact, a Rails application is an Engine in someways. Engines can be "mounted" into others Rails applications (Devise for example). Engines include full MVC architecture for you to play with. Whereas Gem are not meant to include controllers, views and routes. Gems are meant to add new functionality to Ruby.

Upvotes: 2

Related Questions