Module: CarrierWave::Uploader::Url

Defined in:
lib/carrierwave/uploader/url.rb

Instance Method Summary collapse

Instance Method Details

#urlObject

Returns

String

the location where this file is accessible via a url



11
12
13
14
15
16
17
# File 'lib/carrierwave/uploader/url.rb', line 11

def url 
  if file.respond_to?(:url) and not file.url.blank?
    file.url
  elsif current_path
    File.expand_path(current_path).gsub(File.expand_path(root), HasMedia.directory_uri)
  end 
end