Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6683777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:51:40+00:00 2026-05-26T04:51:40+00:00

This is more for experimentation – I am aware that I can do this

  • 0

This is more for experimentation – I am aware that I can do this with –full but I wanted the functionality of namespacing in the app to avoid conflicts

The idea is to have a main app – which handles authentication, common items, admin screens etc
Then creating engines to add further functionality like

  • crm
  • cms
  • blog
  • wiki
  • forum
  • etc

These engines I can pick and choose as I need for whatever kind of app I am building.
Is this possible?

Is it just the case of applying both –mountable and –full options?

Experimenting – would there be any issue if I use the full option add rspec and then simple add

rails plugin new plugin_name --skip-test-unit --full --dummy-path=spec/dummy

and in lib\plugin_name\engine.rb

module PluginName
  class Engine < Rails::Engine

    # this is added by rails when an engine is mountable 
    # to isolate the plugin and prevent name clashes
    isolate_namespace PluginName

    # one of the additions to make rspec work from command line for the plugin
    config.generators do |g|
      g.test_framework :rspec, :view_specs => false
    end   
  end
end 

I have already created both –full and –mountable engines and have rspec finally working for anyone reading there are some great articles (see below), but wondered of the wider impact of doing this for the solution I am trying to create

I am still playing with this and will post my findings..
Any help/discussion will be massively appreciated.

Please Note

  1. Why I want to do it – build once use many times…
  2. I would never want a non-tech/client to add “plugins/engines” – this is purely to entertain point 1.

Issues I am Having…

  1. Running the server on the top level app. Only when accessing content from the engine, (I can see by the error messages) I have a routing problem (root_path undefined or devise routes missing) – the parent application layout is being rendered, I can see it in the extracted source of the error. Progress but no cigar just yet!

Useful References

  • Engines vs Mountable Apps
  • 3.1 engines with rspec
  • testing rails 3 engines
  • Listing Routes in a Mountable engine
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:51:40+00:00Added an answer on May 26, 2026 at 4:51 am

    I managed to get this working with the following steps:

    1. In my parent app I was mounting the engine in routes.rb

      mount PluginName::Engine => '/plugin_name'
      

      I just removed it.

    2. Created an application controller as Ryan Bigg below had stated.

      class PluginName::ApplicationController < ApplicationController
        ...
      end
      
    3. As I wanted to have things name spaced when generating controllers, models, tests so you have to essentially comment out the isolate_namespace PluginName lib\plugin_name\engine.rb when I wanted the gem to be run in the parent app.

      It is not yet an ideal solution. off the top off my head, I could use something like:

      isolate_namespace PluginName if %w[development testing].include?(Rails.env)
      

      but will have to test if this is practical.

    Kudos to Ryan for helping me find my way many thanks

    Furthermore, the same can be done with the –mountable switch version and all you need to do is one further step in your engines config/routes.rb replace

    PluginName::Engine.routes.draw do
    

    with

    Rails.application.routes.draw do
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is more of a business-oriented programming question that I can't seem to figure
This is more of an generic XML Schema question, but if and how do
So this is IT more than programming but Google found nothing, and you guys
This may have been already asked but I can't seem to find this specific
This is more of an academic inquiry than a practical question. Are there any
This is more an observation than a real question: MS-Access (and VBA in general)
This is more of a syntax question I'm trying to write a store procedure
Ok this is more of a computer science question, than a question based on
A discussion about Singletons in PHP has me thinking about this issue more and
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.