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…), Rails’ respond_to method, FastCGI und Standard Out, From Parallels Desktop to VirtualBox, Rails 2.1: send_file :x_sendfile => true, Using rubyzip to create zip files on the fly, 3 days with Linux, Rails Links, Turning off x_send_file in development mode, PDF::Writer and Ruby on Rails 2.1
Post a Comment