Class: Para::AttributeField::ImageField

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

Instance Attribute Summary

Attributes inherited from Base

#field_method, #field_type, #model, #name, #options, #type

Instance Method Summary collapse

Methods inherited from Base

#attribute_column_path, #determine_name_and_field_method!, #field_name, field_option, #field_options, field_types, #initialize, #parse_input, register, #searchable?, #type?

Constructor Details

This class inherits a constructor from Para::AttributeField::Base

Instance Method Details

#excerptable_value?Boolean

Returns:

  • (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