How to change the image assets path in Rails
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
Share This
— Trackback URI
This entry (permalink) was posted on Sunday, November 1, 2009, at 9:16 am by Michael, tagged with Tipps and categorized in Rails.
The following post could be of some interest: Handle EXIF data with ruby (and style…), Migrate OS X to a bigger hard disk, Rails’ respond_to method, FastCGI und Standard Out, Rails 2.1: send_file :x_sendfile => true, From Parallels Desktop to VirtualBox, Rails Links, PDF::Writer and Ruby on Rails 2.1, 3 days with Linux, Using rubyzip to create zip files on the fly
Post a Comment