-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What are engines? #4
Comments
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. |
http://edgeapi.rubyonrails.org/classes/Rails/Engine.html So Engines are a way to DRY up your apps by sharing common functionality without having to mess with the main app's code. |
I found few interesting links: 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. |
Just found Ryan Bigg's talk about Engines https://vimeo.com/41952172 |
@samnang 👍 thanks for the video |
Excellent resources everyone +1. These will be of a great help to newcomers. |
@codereading/readers
Seeing as this is the first project to use Rails Engines it be a good start to understand exactly what an engine is.
How does an independent engine hook into a rails app? How does it get access to the rails apps db, params etc.
What other ways are there to create a project for rails use and how do they differ? Why would you choose one way over another?
I.e. why an engine and not just a simple gem. When should you use a vendored plugin?
Just some questions swimming in my mind.
The text was updated successfully, but these errors were encountered: