Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created August 6, 2010 05:24
Show Gist options
  • Save teeparham/510888 to your computer and use it in GitHub Desktop.
Save teeparham/510888 to your computer and use it in GitHub Desktop.
hack around rackspace CDN SSL limitation
def cloud_image_path(source)
if %w{development test}.include?(Rails.env) || request.ssl?
image_path(source)
else
"http://yourpath.cdn.rackspacecloud.com/" + source.split("/").last
end
end
def cloud_image_tag(source, options={})
image_tag(cloud_image_path(source), options)
end
cloud_image_path('/images/subdir/whatever.jpg')
cloud_image_tag("logo.gif", :usemap=>"#Homelink", :alt=>"logo", :width=>123, :height=>45)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment