ruby on rails - Using layouts from a mountable engine -


I'm looking for the following problem:

The db_core app contains only a small model core system. The Db_core app will not have any views.

At the top of the DB_core app we have an admin interface. It will be a mountable engine, the admin interface will serve assets such as JavaScript, CSS, Image etc.

Finally we will have additional mountable engines; like. "Blog", "Forum", "Authentication" which will be mounted on the db_core application, and all of these mountable engines should have the same layout as the Admin Interface Engine.

I have a test and are running where db_core provides app properties, but I am not able to figure out how to serve the properties to any other engine, so the db_core application is small And remain free from any property and scenes.

  • db_core
    • Engine A -> Admin Interface (Property)
    • Engine B, C, D, ... - & gt; Other other engines using assets from Engine A

      < P> I think that you actually mean a separate engine "separate" you can write an engine that is mountable but not separate - it basically means that it has got its routing, but otherwise A plain old school is similar to a non-separate engine.

      But I've stopped typing my engines as separate for reasons like this: I rarely want an engine which is actually different from the host app, usually looking at the templates (Especially if there is no layout) that I want to be able to access the host app (and ride more than my own local template) by giving it only that name, but load it in the first Host App on the remote), and / or host adjunct app wants to take advantage in a method-by-method should be able to get on base and / or I host application assets do more. Yes, you can write a generator to make them copy, but 'freezes' them in the host application and may have further-compatibility issues.

      So, personally, I tell different engines the cause of more problems than they solve, I use only one 'normal' engine, and separates those parts Those who need to be distinguished correctly (for example module namespace controller).

      Routing / Mountable I do not use Rail 'mountable' engines, but I automatically have my own engine / config / routes.rb automatically load the host application in the host application Add the route from. Instead, I have a non-mountable engine that provides a way that hosts applications can put in their own routes. RB (with a routing object given as an RG), which is called, will add engine-required routing to the app. Method Logic (can only add some routes, but not the other, use custom routing namespaces, whatever happens) to customize things.

      I think Rail 3 is an intangible high level of mounting / separation for you to make a 'plain' engine properly designed to make it a perfect way to integrate it with the app, A bunch cures, the result is in some cases that is okay only for some use cases. If you really want an engine that is completely separate subsystem, make sure that if you have to write an engine that works with any rack app and not only rail, you can completely separate it Need to run as a separate sub-system (this is exactly where this is how it is made), but you are giving a lot to do this. But I believe that this is not really the future of "Generally the best way to build an engine from now on".

      Whatever you are trying to do, I think that your engine is going to be a separate counter productive, do not separate them, but then there are some things that your engine can do differently, It will be known about the method of dealing with different types of methods (and the way you do not want it), this is true - this stuff is not sad.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -