Ruby on Rails Rails -Engines

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

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.

Syntax

  • rails plugin new [engine name] --mountable

Parameters

ParametersPurpose
--mountableoption tells the generator that you want to create a "mountable" and namespace-isolated engine
--fulloption tells the generator that you want to create an engine, including a skeleton structure

Remarks

Engines are very good options for creating reusable plugin for rails application



Got any Ruby on Rails Question?