Module: ConveyancesHelper

Defined in:
app/helpers/conveyances_helper.rb

Instance Method Summary collapse

Instance Method Details

#conveyance_tag(conveyance) ⇒ Object



3
4
5
6
# File 'app/helpers/conveyances_helper.rb', line 3

def conveyance_tag(conveyance)
  return nil if conveyance.nil?
  [ sound_tag(conveyance.sound), 'on', object_tag(conveyance.conveyance_object)  ].compact.join(' ').html_safe
end

#conveyances_list_tag(object) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/conveyances_helper.rb', line 13

def conveyances_list_tag(object)
  if object.conveyances.any?
    object.conveyances.collect{|c|
      (:div) do
        safe_join([
          audio_tag(c.sound.sound_file, controls: true), 
          (:div, conveyance_tag(c))
        ])
      end
    }.join.html_safe
  end
end

#label_for_conveyance(conveyance) ⇒ Object



8
9
10
11
# File 'app/helpers/conveyances_helper.rb', line 8

def label_for_conveyance(conveyance)
  return nil if conveyance.nil?
  [ label_for_sound(conveyance.sound), 'on', label_for(conveyance.conveyance_object)  ].compact.join(' ')
end