Sha256: 1e904cfbcadb2a8d59dd602b0726c511b9996094f928260512305a402d60b5aa

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 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.0 lib/occams/content/tags/wysiwyg.rb