Sha256: 1a0b327d134ee63535f2b92d0f43d60a4f5e3608427e4704b00ed8516399a098
Contents?: true
Size: 793 Bytes
Versions: 51
Compression:
Stored size: 793 Bytes
Contents
# frozen_string_literal: true module CKEditor5::Rails::Hooks module SimpleForm class CKEditor5Input < ::SimpleForm::Inputs::Base def input(wrapper_options = nil) merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) @builder.template.ckeditor5_editor(**editor_options(merged_input_options)) end private def editor_options(merged_input_options) { preset: input_options.fetch(:preset, :default), type: input_options.fetch(:type, :classic), config: input_options[:config], initial_data: object.try(attribute_name) || input_options[:initial_data], name: "#{object_name}[#{attribute_name}]", **merged_input_options } end end end end
Version data entries
51 entries across 51 versions & 1 rubygems