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
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...
— 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, Migrate OS X to a bigger hard disk, FastCGI und Standard Out, Rails 2.1: send_file :x_sendfile => true, Rails Links, From Parallels Desktop to VirtualBox, PDF::Writer and Ruby on Rails 2.1, Preparing for Rails 2.3.9, Disable Ruby On Rails Sessions
Post a Comment