Sha256: aa2e082463c639a0be6f3fd2cbb2241b7a09d349f32058770232d05e20d11708

Contents?: true

Size: 480 Bytes

Versions: 15

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

require_relative 'preset_builder'
require_relative 'preset_serializer'

module CKEditor5::Rails::Context
  module Helpers
    def ckeditor5_context(preset = nil, &block)
      preset ||= PresetBuilder.new
      context_props = PresetSerializer.new(preset)

      tag.public_send(:'ckeditor-context-component', **context_props.to_attributes, &block)
    end

    def ckeditor5_context_preset(&block)
      PresetBuilder.new(&block)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ckeditor5-1.19.5 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.19.4 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.19.3 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.19.2 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.19.1 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.19.0 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.18.3 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.18.1 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.18.0 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.17.4 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.17.3 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.17.2 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.17.1 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.17.0 lib/ckeditor5/rails/context/helpers.rb
ckeditor5-1.16.2 lib/ckeditor5/rails/context/helpers.rb