Rails mountable engine projects
A mountable engine in Ruby on Rails is a self-contained, reusable mini-application that can be integrated into a larger Rails app. It has its own routes, controllers, models, and views, all namespaced to avoid conflicts with the main app. Mountable engines are typically used to modularize functionality, making features like admin dashboards, authentication systems, or forums reusable across multiple projects. Once created, the engine is "mounted" into the parent app’s routes, allowing it to function seamlessly as part of the larger system.
Refer to the following topics for procedures on creating and configuring Rails mountable engine projects:
Embed a Rails mountable engine into a Rails application
Open the target Rails project, where an engine should be embedded.
Open the Gemfile and add the engine gem. For example, add the following line for the engine placed by the engines/blorgh path:
gem 'blorgh', path: 'engines/blorgh'Open Config/routes.rb and add the line to make the engine's functionality accessible within an application, for example:
mount Blorgh::Engine, at: "/blog"