Class: Administrate::Field::Paperclip

Inherits:
Base
  • Object
show all
Defined in:
lib/administrate/field/paperclip.rb

Defined Under Namespace

Classes: Engine

Instance Method Summary collapse

Instance Method Details

#style(size = big_style) ⇒ Object Also known as: url



10
11
12
# File 'lib/administrate/field/paperclip.rb', line 10

def style(size = big_style)
  data.try(:url, size) || ''
end

#thumbnailObject



16
17
18
# File 'lib/administrate/field/paperclip.rb', line 16

def thumbnail
  style(thumbnail_style)
end

#url_only?Boolean

Just display the URL as a link, rather than trying to make it an image

Returns:

  • (Boolean)


21
22
23
# File 'lib/administrate/field/paperclip.rb', line 21

def url_only?
  options.fetch(:url_only, false)
end