1 # frozen_string_literal: true
3 # A custom richtext_field form group. By using form_group_builder we get to use
4 # the built-in methods for generating labels and help text.
8 extend ActiveSupport::Concern
11 # It's not clear to me why this needs to be duplicated from the upstream BootstrapForm::FormBuilder class
12 delegate :content_tag, :capture, :concat, :tag, :to => :@template
15 def richtext_field_with_bootstrap(name, options = {})
16 id = "#{@object_name}_#{name}"
17 type = options.delete(:format) || "markdown"
19 form_group_builder(name, options) do
20 @template.render(:partial => "shared/richtext_field",
21 :locals => { :object => @object,
23 :object_name => @object_name,
31 alias_method :richtext_field, :richtext_field_with_bootstrap