Currently, I'm working on a Rails project where I use a Bootstrap-Theme (CSS-Files, JavaScript-Files and so on) which I've included as a Gem in the rails project.
The Markup in the views is dependent on this Bootstrap-Theme. We have other Rails-Engines included in this project which also depends on the markup of this Gem for the views.
What we want to do is to develop a "Templating"-System. Lets say we have a defined box, which has a header and a body. Then if the Bootstrap-Theme is included, it attaches the appropriate Bootstrap Markup. If another Theme is used, the appropriate markup will be attached for this Theme.
Right now, if we want to exchange the Bootstrap-Template in the future with a e.g. Zurb-Foundation-Template. Then we're lost, because we have to refactor each and every view and replace the Bootstrap-Like Markup with the Zurb one.
The first idea was to develop this templating in JavaScript which will change the CSS-Classes on document ready, but this is not capable to handle large DOM trees.
Are there any Gems available for this purposes? How can such a system be implemented in Ruby / Rails?
Thanks in advance!