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

帅比萌擦擦* 提交于 2019-12-21 11:36:27

问题


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!


回答1:


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




回答2:


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




回答3:


I recommend you have a look here:

https://github.com/krschacht/rails_3_engine_demo

Or the more famous:

https://github.com/josevalim/enginex



来源:https://stackoverflow.com/questions/4993166/making-a-custom-plugin-gem-engine-for-rails-3-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!