Sha256: 5fb97603b09e2437fb436a4de91a4d9339c245c5eede2e073b55d9771b54da1a

Contents?: true

Size: 628 Bytes

Versions: 3

Compression:

Stored size: 628 Bytes

Contents

# Tag for text content that is going to be rendered using Redactor (default) in
# the admin area
#   {{ cms:wysiwyg identifier }}
#
#
class ComfortableMexicanSofa::Content::Tag::Wysiwyg < ComfortableMexicanSofa::Content::Tag::Fragment

  def form_field(object_name, view, index, &block)
    name    = "#{object_name}[fragments_attributes][#{index}][content]"
    options = {id: nil, data: {"cms-rich-text" => true}}
    input   = view.send(:text_area_tag, name, self.content, options)
    yield input
  end
end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-2.0.2 lib/comfortable_mexican_sofa/content/tags/wysiwyg.rb
comfortable_mexican_sofa-2.0.1 lib/comfortable_mexican_sofa/content/tags/wysiwyg.rb
comfortable_mexican_sofa-2.0.0 lib/comfortable_mexican_sofa/content/tags/wysiwyg.rb