I found no other way to change the path of “images” in a Rails application than monkey patching the AssetTagHelper like so:
module ActionView module Helpers #:nodoc: module AssetTagHelper def image_path(source) compute_public_path(source, 'static_images') end alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route end end end |
No comments yet
Post a Comment