How do I override asset_path while retaining access to the original?

I’ve been banging my head on this for some days.

I am working on a multi-tenant rails application that wants to use themes for each tenant.

I have managed to customize view template finding with FileSystemResolver so that it prepends the current domain to the view search path and, if not found, removes it and uses the original one. This works.

Assets, OTOH, have me stumped. As near as I can figure, everything goes through ActionView::Helpers::AssetUrlHelper.asset_path(source,options). That mostly does what I want but I want to prepend the domain to the source path.

To make things extra fun, half the assets/views are in a gem (using Solidus as our store) and so a lot of my controllers are straight out of the Solidus engine.

I could really use some guidance on getting this working.


Did you find a solution to this? We’re currently at the same point.