Method: TransitHelper#audio_player
- Defined in:
- app/helpers/transit_helper.rb
#audio_player(source, html_attrs = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/transit_helper.rb', line 31 def audio_player(source, html_attrs = {}) attrs = { id: "audio_player_#{Time.now.to_i}", class: 'audio_player' } wrapper = html_attrs.delete(:wrapper) || :div data_attrs = { source: source } html_attrs.reverse_merge!( attrs.merge!(data: { context_attributes: Base64.encode64s(data_attrs.to_json) }) ) content_tag(wrapper, "", html_attrs) end |