How to add a mounted engine to a Rails 3.1 application?

Let's say I created a mounted engine in the ~/my_engine :

 rails plugin new my_engine --mountable 

How to install this engine in a Rails 3.1 application that is at the same directory level (e.g. ~/my_app )?

+4
source share
1 answer

There is a good process entry here:

http://www.builtfromsource.com/2010/12/13/mountable-engines-in-rails-3-1-beta-getting-started/

In short, add this to your main Gemfile application:

 gem 'my_engine', :path => '../my_engine' 

And run bundle install / bundle update . Add this to the main application

 mount MyEngine::Engine => '/my-engine-url' 
+5
source

Source: https://habr.com/ru/post/1381156/


All Articles