Reputation: 2396
I want to create a parent application that deals with the User Authentication. I then want to create various Mountable Engines (like a blog, contact directory, etc.) that can be added as needed. This means that I will need to access the User Authentication data (admin rights, etc.) from the Mountable Engine.
I would like to know how (and if) this is possible, as it is evident that the Engine Models are accessible in the parent application it is integrated in to, but not the other way round.
When this question was asked here, the answer given shows how to get all data, not things from helpers (like current_user).
When it was asked here, it seemed to cover namespacing, not the how to access functions and variables (unless I'm missing something).
Any help would be greatly appreciated.
Upvotes: 4
Views: 2133
Reputation: 35541
By design, Mountable Engines are isolated from their parent. However, you can in theory expose portions of the parent through a REST API using ActiveResource or the like. You can also use a 'Full Engine' which acts as a sort of plugin rather than a Mountable one - Rails 3.1: Engine vs. Mountable App
Upvotes: 1