Class: Para::AttributeField::ImageField

Inherits:
AttributeField::Base
  • Object
show all
Includes:
ActionView::Helpers::AssetTagHelper
Defined in:
lib/para/attribute_field/image.rb

Instance Method Summary collapse

Instance Method Details

#excerptable_value?Boolean



16
17
18
# File 'lib/para/attribute_field/image.rb', line 16

def excerptable_value?
  false
end

#value_for(instance) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/para/attribute_field/image.rb', line 8

def value_for(instance)
  style = attachment_thumb_style_for(instance)

  if instance.send(:"#{ name }?")
    image_tag(instance.send(name).url(style))
  end
end