Sha256: 76ca1a011a8eba917fd4b551a138436776595020e94c47d21b485365a1fc31d3
Contents?: true
Size: 594 Bytes
Versions: 31
Compression:
Stored size: 594 Bytes
Contents
module Alchemy module Ingredients class RichtextView < BaseView attr_reader :plain_text # @param ingredient [Alchemy::Ingredient] # @param plain_text [Boolean] (false) Whether to show as plain text or with markup def initialize(ingredient, plain_text: nil, html_options: {}) super(ingredient) @plain_text = settings_value(:plain_text, value: plain_text, default: false) end def call if plain_text ingredient.stripped_body else value.to_s.html_safe end.html_safe end end end end
Version data entries
31 entries across 31 versions & 1 rubygems