Class: Trek::Form::SoundFieldComponent
- Inherits:
-
ViewComponent::Form::FileFieldComponent
- Object
- ViewComponent::Form::FileFieldComponent
- Trek::Form::SoundFieldComponent
show all
- Includes:
- CssClassesHelpers, StimulusHelpers, Turbo::FramesHelper
- Defined in:
- app/components/trek/form/sound_field_component.rb
Instance Method Summary
collapse
#stimulus_action, #stimulus_class, #stimulus_class_hash, #stimulus_class_key, #stimulus_target, #stimulus_target_hash, #stimulus_target_key, #stimulus_value, #stimulus_value_hash, #stimulus_value_key
#class_for, #class_names_for, #root_class
#identifier
Instance Method Details
#button_text ⇒ Object
32
33
34
|
# File 'app/components/trek/form/sound_field_component.rb', line 32
def button_text
sound&.exists? ? t("admin.actions.replace") : t("admin.actions.browse")
end
|
#cached_data ⇒ Object
22
23
24
|
# File 'app/components/trek/form/sound_field_component.rb', line 22
def cached_data
object.public_send(:"cached_#{method_name}_data")
end
|
#existing_data ⇒ Object
18
19
20
|
# File 'app/components/trek/form/sound_field_component.rb', line 18
def existing_data
object.public_send(:"#{method_name}_data")
end
|
#file_field_data_attributes ⇒ Object
26
27
28
29
30
|
# File 'app/components/trek/form/sound_field_component.rb', line 26
def file_field_data_attributes
{
action: stimulus_action("addFiles")
}.merge(stimulus_target_hash("fileInput"))
end
|
#sound ⇒ Object
10
11
12
|
# File 'app/components/trek/form/sound_field_component.rb', line 10
def sound
object.public_send(:"#{method_name}")
end
|
#sound_url ⇒ Object
14
15
16
|
# File 'app/components/trek/form/sound_field_component.rb', line 14
def sound_url
object.public_send(:"#{method_name}_url")
end
|