Sha256: 844e1459a7a596b144feeed319f0fed5c2627f5b7d4c06c4979b6509206339e5
Contents?: true
Size: 727 Bytes
Versions: 31
Compression:
Stored size: 727 Bytes
Contents
module Alchemy module Ingredients class AudioView < BaseView def call content_tag(:audio, **html_options) do tag(:source, src: src, type: type) end.html_safe end def render? !!ingredient.attachment end private def src alchemy.show_attachment_path( ingredient.attachment, format: ingredient.attachment.suffix ) end def type ingredient.attachment.file_mime_type end def html_options { controls: ingredient.controls, autoplay: ingredient.autoplay, loop: ingredient.loop, muted: ingredient.muted } end end end end
Version data entries
31 entries across 31 versions & 1 rubygems