Sha256: 6e999e055cc410537f6e4bf8af7caccefd4f3f42811984904e1282b3247210ae

Contents?: true

Size: 595 Bytes

Versions: 10

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

10 entries across 10 versions & 1 rubygems

Version Path
occams-1.0.7.3 lib/occams/content/tags/wysiwyg.rb
occams-1.0.7.2 lib/occams/content/tags/wysiwyg.rb
occams-1.0.7.1 lib/occams/content/tags/wysiwyg.rb
occams-1.0.7 lib/occams/content/tags/wysiwyg.rb
occams-1.0.6.1 lib/occams/content/tags/wysiwyg.rb
occams-1.0.6 lib/occams/content/tags/wysiwyg.rb
occams-1.0.5 lib/occams/content/tags/wysiwyg.rb
occams-1.0.4 lib/occams/content/tags/wysiwyg.rb
occams-1.0.3 lib/occams/content/tags/wysiwyg.rb
occams-1.0.2 lib/occams/content/tags/wysiwyg.rb