Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a custom plugin/gem/engine for Rails 3 app

I am following the guide http://edgeguides.rubyonrails.org/plugins.html and it seems to be slightly outdated. Could you have a look on it and tell me which sections should be done in a different way in Rails 3?

EDIT1: Links to alternative tutorials are also very welcome!

like image 876
Andrei Avatar asked Feb 14 '11 14:02

Andrei


3 Answers

You're right, that guide isn't the best (the last changelog entry is April 2010).

Instead, I'd recommend you read: https://github.com/radar/guides/blob/master/gem-development.md

like image 75
DanS Avatar answered Oct 19 '22 22:10

DanS


I bumped into this question, and the answers are now outdated. The railsguide is currently up to date: http://guides.rubyonrails.org/engines.html

The enginex gem has been integrated into rails, and creating an engine is now as simple as:

rails plugin new your-gem-name  --full

Much like the rails new command, this will create a new folder, containing a blank gem for you to fill in. This gem is automatically an engine. For more options (e.g. --mountable check the documentation).

like image 33
nathanvda Avatar answered Oct 19 '22 23:10

nathanvda


I recommend you have a look here:

https://github.com/krschacht/rails_3_engine_demo

Or the more famous:

https://github.com/josevalim/enginex

like image 28
apneadiving Avatar answered Oct 19 '22 22:10

apneadiving