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

28 views
Skip to first unread message

Todd Blanchard

unread,
May 13, 2018, 7:47:07 PM5/13/18
to Ruby on Rails: Talk
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.

Thanks.

Niklas Bichinger

unread,
Jan 8, 2020, 11:25:41 AM1/8/20
to Ruby on Rails: Talk
Did you find a solution to this? We're currently at the same point.
Reply all
Reply to author
Forward
0 new messages