Tutorial by Topics: engines



Often the server needs to serve pages dynamically.For an example an user Mr.X visits the page and sees some thing like "Welcome Mr. X to my homepage".In this case views can be helpful.Even to populate a table view can be handy. Variables can be injected into HTML dynamically using view engine.View engine is something that renders the views.One can keep views to be served in a folder called view and serve upon request .The path of the folder can be shown to Express using path.resolve method .

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 behavior from Rails::Engine.

Engines are the reusable rails applications/plugins. It works like a Gem. Famous engines are Device, Spree gems which can be integrated with rails applications easily.


Page 1 of 1