Sha256: e48c9cb9159c24db6dbade65fe10e5a70ceb394dc6b71548dd57799e9c4ff83f
Contents?: true
Size: 717 Bytes
Versions: 25
Compression:
Stored size: 717 Bytes
Contents
module Alchemy module Ingredients class AudioView < BaseView def call content_tag(:audio, **html_options) do tag(:source, src: src, type: type) end 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
25 entries across 25 versions & 1 rubygems