Krapi Rastogi
Krapi Rastogi

Reputation: 53

Adding new files in Rails engine's lookup context

I am making a rails engine which has a themes folder , in app/apps/themes . When you install the gem in a host application , the user should have the ability to add a new theme depending on their choice. But how should the theme and its views access the data present in the tables already created by the engine. Also how will the engine's configuration about the new theme and using it ?

For now in the engine , in my controller I have prepended the view paths of some dummy themes , like this

prepend_view_path MyEngine::Engine.root.join("app/apps/themes/#{session[:current_theme]}/views")

The current_theme in session storage stores the picked theme, but in the host application , how will I make it know about the new theme thats's been added...

Upvotes: 0

Views: 38

Answers (0)

Related Questions