You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As fas as I know, a rails engine is a way to share app controllers, models, and views to other apps. In rails 3, every rails app is also engine and can be bundled as a gem as well.
There are two types of rails engines: mountable and full engine. Mountable engine is designed to be namespaced controllers, models,... For example, a forem engine, add forum to any existing rails applications. Some engines use the existing application layout (forem) or use its own layout (spree). A full engine is to augment something to an existing rails app.
Vendored plugins are deprecated in Rails 4.0, and I think people will stop using that.
Engines can be considered miniature applications that provide functionality to their host applications. A Rails application is actually just a “supercharged” engine, with the Rails::Application class inheriting a lot of its behaviour from Rails::Engine.
I'm still not so clear what are the benefit to create full engines instead mountable engines? Because I think most of the time we need mountable engines.
Activity
chamnap commentedon Aug 30, 2012
As fas as I know, a rails engine is a way to share app controllers, models, and views to other apps. In rails 3, every rails app is also engine and can be bundled as a gem as well.
There are two types of rails engines: mountable and full engine. Mountable engine is designed to be namespaced controllers, models,... For example, a forem engine, add forum to any existing rails applications. Some engines use the existing application layout (forem) or use its own layout (spree). A full engine is to augment something to an existing rails app.
Vendored plugins are deprecated in Rails 4.0, and I think people will stop using that.
agis commentedon Aug 30, 2012
http://edgeapi.rubyonrails.org/classes/Rails/Engine.html
http://railscasts.com/episodes/277-mountable-engines
http://www.stubbleblog.com/index.php/2011/04/writing-rails-engines-getting-started/
So Engines are a way to DRY up your apps by sharing common functionality without having to mess with the main app's code.
samnang commentedon Sep 2, 2012
I found few interesting links:
http://edgeguides.rubyonrails.org/engines.html (I'm not sure why this page doesn't list in RailsGuides Index)
http://gregmoreno.wordpress.com/2012/05/29/create-your-own-rails-3-engine/
http://stackoverflow.com/questions/6118905/rails-3-1-engine-vs-mountable-app
http://www.astjohn.ca/2011/08/06/rails-31-engines-mountable-or-full-part-1
http://www.astjohn.ca/2011/08/07/rails-31-engines-mountable-or-full-part-2
I'm still not so clear what are the benefit to create full engines instead mountable engines? Because I think most of the time we need mountable engines.
samnang commentedon Sep 2, 2012
Just found Ryan Bigg's talk about Engines https://vimeo.com/41952172
orlando commentedon Sep 3, 2012
@samnang 👍 thanks for the video
adamakhtar commentedon Sep 6, 2012
Excellent resources everyone +1. These will be of a great help to newcomers.
agis commentedon Sep 25, 2012
http://confreaks.com/videos/1109-gogaruco2012-writing-a-rails-engine