Sha256: 83cd9ea357647b01430f15c72f14b175c72834b8d8e477633ae87d69ad9455a9
Contents?: true
Size: 584 Bytes
Versions: 25
Compression:
Stored size: 584 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 end end end end
Version data entries
25 entries across 25 versions & 1 rubygems