Sha256: 2ec0740a7d85d8d36f1a7091edb7d708261fb75b347ddd290faaa9c2d2eb094b
Contents?: true
Size: 476 Bytes
Versions: 71
Compression:
Stored size: 476 Bytes
Contents
module ApplicationHelper def image_absolute_url(source) # this should work, but there's something funky going on with the asset paths host = Rails.application.routes.default_url_options[:host] path = ActionController::Base.helpers.asset_path(source, type: :image) path = path.gsub(host,'') path = (host + path).gsub('//','/') 'http://' + path # 'http://' + Rails.application.routes.default_url_options[:host] + '/assets/' + source end end
Version data entries
71 entries across 71 versions & 1 rubygems