I have the following project structure:
/app /config /db ... /themes /default /assets /images /stylesheets /... /views /... /theme1 /assets /... /views /...
'default' theme should be used by default :). 'theme1' - you should redefine any, for example, logo.png or view (application.erb).
It should work as follows: try to get the asset from "theme1", if it is missing, use "default".
Pretty simple with views:
self.prepend_view_path ::ActionView::FileSystemResolver.new(theme_view_path_for(name)) self.prepend_view_path ::ActionView::FileSystemResolver.new(default_theme_path)
But I cannot resolve this with assets.
config.assets.paths << "#{Rails.root}/themes/default/assets/stylesheets" config.assets.paths << "#{Rails.root}/themes/default/assets/images" config.assets.paths << "#{Rails.root}/themes/default/assets/javascript"
This adds assets as usual, for example, access to the resource can be obtained using the url 'assets / logo.png', but I need one prefix - "assets / theme1 / logo.png". Also, if "theme1" does not redefine logo.png with "assets / theme1 / logo.png", then the URL should be returned. (Similarly above with views).
I tried theme_for_rails - but it does not work, because they redefine the entire structure of the assets (own controller for maintenance, etc.).
In addition, it would be great to be able to connect to assets, when accessing logo1.png it should be possible to execute it with my controller and, for example, return it from the database.
Thanks for any advice, I will share the results at the end.
Kirill Salykin