Method: Paperclip::Attachment#url
- Defined in:
- lib/paperclip/attachment.rb
#url(style_name = default_style, use_timestamp = @use_timestamp) ⇒ Object
Returns the public URL of the attachment, with a given style. Note that this does not necessarily need to point to a file that your web server can access and can point to an action in your app, if you need fine grained security. This is not recommended if you don’t need the security, however, for performance reasons. Set use_timestamp to false if you want to stop the attachment update time appended to the url
116 117 118 119 |
# File 'lib/paperclip/attachment.rb', line 116 def url(style_name = default_style, = @use_timestamp) url = original_filename.nil? ? interpolate(@default_url, style_name) : interpolate(@url, style_name) && updated_at ? [url, updated_at].compact.join(url.include?("?") ? "&" : "?") : url end |