New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/assets #350
Feature/assets #350
Conversation
You can easily add assets through vendor/assets then include them in manifest files. Why do it this way? |
The CUSTOM_ASSET_PATH is a mess by itself. I did a search on CUSTOM_ASSET_PATH. and found:
some of them use relative path, others use absolute path. Do you have to include CUSTOM_ASSET_PATH in all the places where custom images are required? it cluttered the code. and about the search path: the CUSTOM_ASSET_PATH directory hasn't been added to the search path. So the above image tag image_tag("#{CUSTOM_ASSET_PATH}about.png" will result in 404 not found since CUSTOM_ASSET_PATH is not even in the search path for assets.
|
according to: any directories under app/assets directory will be added to assets_path. class Engine < Railtie
# Skip defining append_assets_path on Rails <= 4.2
unless initializers.find { |init| init.name == :append_assets_path }
initializer :append_assets_path, :group => :all do |app|
if paths["app/assets"].respond_to?(:existent_directories)
app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
else
app.config.assets.paths.unshift(*paths["vendor/assets"].paths.select { |d| File.directory?(d) })
app.config.assets.paths.unshift(*paths["lib/assets"].paths.select { |d| File.directory?(d) })
app.config.assets.paths.unshift(*paths["app/assets"].paths.select { |d| File.directory?(d) })
end
end
end
end
end You don't even need custom_asset_path. All you need do is add an image_override directory under app/assets. then it will find it. |
Sounds good to me |
add support to override asset loading path.
just create a directory in Rails.root called themes. and put assets inside it. it will be the first to be loaded.