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

2019-04-07 03:36发布

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!

3条回答
smile是对你的礼貌
2楼-- · 2019-04-07 04:23

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).

查看更多
Fickle 薄情
3楼-- · 2019-04-07 04:24
老娘就宠你
4楼-- · 2019-04-07 04:25

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

查看更多
登录 后发表回答