I am creating a simple theme system for a rails 3 application. A theme consists of a folder placed in Rails.root / themes containing
- Manifest file .yml
- some liquid template files
- Static Assets Subfolder
Now for a specific controller / action, I would like to visualize the views from the current topic and, accordingly, use static assets.
Therefore, I need a way to tell the rails to rewrite
http://example.com/theme1/* ----> #{Rails.root}/themes/theme1/assets/*http://example.com/theme2/* ----> #{Rails.root}/themes/theme2/assets/*- ...
Currently, I cannot figure out how to do this, since I would like to avoid using different engines for each topic or copying asset files in the public subfolder.
How can I solve this problem?
edit: other requirements
I was looking for something that did not violate rail defaults, so later I could take advantage of the new pipeline function (planned for rails 3.1).
Currently, I have found only this:
config.asset_path = proc { |asset_path| "assets/#{asset_path}" }
which would completely fulfill my requirements, unfortunately, it will not be applied when the resource pipeline is turned on.
source share