ruby on rails - Add folder to asset pipeline path? -
ruby on rails - Add folder to asset pipeline path? -
we have rails app updated rails 3.0 rails 3.2. app services multiple clients. customize each client, have directory app/themes
. in there submodules. each submodule contains things locales/en.yml
, views/layouts
, views/controller_name
, etc. utilize prepend_view_path
add together theme views, , i18n.load_path
add together in locales. we're looking @ using asset pipeline can maintain mix of client material out of public directory, , maintain contained in each theme.
is there way can dynamically tell rails load theme/theme-name/assets folder want? utilize settings logic set theme active. if have theme set "google", applicationcontroller
loads files path:
app/themes/google/locales/*.yml app/themes/google/views
what i'd able have manifest file,
app/themes/google/assets/stylesheets/application.css
easily accessible layout, much in app/views/layouts
file:
= stylesheet_link_tag "application"
is there way can this? or need manually move assets actual assets directory?
was able in application.rb:
require "#{rails.root}/app/models/settings.rb" config.assets.paths << "#{rails.root}/app/themes/#{settings.theme}/assets/stylesheets" config.assets.paths << "#{rails.root}/app/themes/#{settings.theme}/assets/images" config.assets.paths << "#{rails.root}/app/themes/#{settings.theme}/assets/javascripts"
ruby-on-rails asset-pipeline
Comments
Post a Comment