Sha256: 996450ba4007859b518fa2f569d28d86338ebb6037d9d85f0bc1e175eef124a0

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

# Tag for text content that is going to be rendered using Redactor (default) in
# the admin area
#   {{ cms:wysiwyg identifier }}
#
#
class Occams::Content::Tag::Wysiwyg < Occams::Content::Tag::Fragment
  def form_field(object_name, view, index)
    name    = "#{object_name}[fragments_attributes][#{index}][content]"
    options = { id: form_field_id, data: { "cms-rich-text" => true } }
    input   = view.send(:text_area_tag, name, content, options)
    yield input
  end
end

Occams::Content::Renderer.register_tag(
  :wysiwyg, Occams::Content::Tag::Wysiwyg
)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
occams-1.0.1 lib/occams/content/tags/wysiwyg.rb