Render engine within application layout

后端 未结 3 560
清歌不尽
清歌不尽 2021-01-31 16:47

Background

I am creating a application that is made up of a core and several modules. The modules are rails engines, and provide the actual functionality as the core i

3条回答
  •  無奈伤痛
    2021-01-31 17:30

    I also did the same thing in my application. All I did was:

    1. Delete the engine layout in /app/view/layouts/
    2. Change your application_controller to

      module EngineModule
        class ApplicationController < ::ApplicationController
          layout 'layouts/application' 
        end
      end
      
    3. In your views, if you want to refer to any path such as login_path, it can be referred via main_app.login_path

提交回复
热议问题