You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simplest way I got it to pick up the templates in my mounted engine was to add my engine's template path to the array of the inside_paths config in my main application's (config/application.rb) file.
in my case my engine is mounted in vendor/engines directory as per rails guides documentation.
my engine name "sukumafin"..... so I added it like in the line below.
I guess the catch here is to be cautious when naming your templates so there is no clashes between the app's templates and your engine template names. ...???
My observation here is that engines are simply another railtie added to main application and somehow uses one asset pipeline for js/css. So take due diligence when using angular with engines inside applications that uses angular and angular rails templates. Maybe slightly off the topic but I could not make ui.router work in the setup I have now and had to use "angular-routes" and I also had to ensure that there should are no routes clashing as well.
What worked for me was putting the templates/ directory directly under javascripts/ (not javascripts/engine_name/. Be sure to maintain the namespacing, however. So your final directory structure should be as follows (and this is a frustrating redundancy of Rails)
engine_name (root)
app
assets
javascripts
engine_name
... your js files
templates
engine_name
... your template files
And everything basically works as expected. Be sure to call your template files with the proper name-spacing (engine_name) in front.
How would I go about specifying my config paths if I am using templates inside a rails mountable engine.
The text was updated successfully, but these errors were encountered: