Class: Avo::Fields::FileField::IndexComponent
- Inherits:
-
IndexComponent
- Object
- ViewComponent::Base
- IndexComponent
- Avo::Fields::FileField::IndexComponent
show all
- Defined in:
- app/components/avo/fields/file_field/index_component.rb
Instance Attribute Summary
#view
Instance Method Summary
collapse
#initialize, #resource_path
#edit_field_wrapper, #filter_wrapper, #index_field_wrapper, #item_select_all_input, #item_selector_init, #item_selector_input, #resource_grid, #resource_table, #show_field_wrapper
Instance Method Details
#flush? ⇒ Boolean
4
5
6
|
# File 'app/components/avo/fields/file_field/index_component.rb', line 4
def flush?
has_image_tag? || has_audio_tag?
end
|
#has_audio_tag? ⇒ Boolean
12
13
14
|
# File 'app/components/avo/fields/file_field/index_component.rb', line 12
def has_audio_tag?
@field.value.attached? && @field.is_audio
end
|
#has_image_tag? ⇒ Boolean
8
9
10
|
# File 'app/components/avo/fields/file_field/index_component.rb', line 8
def has_image_tag?
@field.value.attached? && @field.value.representable? && @field.is_image
end
|