Module: CarrierWave::Uploader::Url
- Extended by:
- ActiveSupport::Concern
- Includes:
- Configuration
- Included in:
- Base
- Defined in:
- lib/carrierwave/uploader/url.rb
Instance Method Summary collapse
- #to_s ⇒ Object
-
#url(options = {}) ⇒ Object
Parameters.
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/carrierwave/uploader/url.rb', line 26 def to_s url || '' end |
#url(options = {}) ⇒ Object
Parameters
- Hash
-
optional, the query params (only AWS)
Returns
- String
-
the location where this file is accessible via a url
18 19 20 21 22 23 24 |
# File 'lib/carrierwave/uploader/url.rb', line 18 def url( = {}) if file.respond_to?(:url) and not file.url.blank? file.method(:url).arity == 0 ? file.url : file.url() elsif current_path (base_path || "") + File.(current_path).gsub(File.(root), '') end end |