diff --git a/lib/alchemy/forms/builder.rb b/lib/alchemy/forms/builder.rb index e0c6f95f5e..a82548fa7b 100644 --- a/lib/alchemy/forms/builder.rb +++ b/lib/alchemy/forms/builder.rb @@ -43,6 +43,13 @@ def datepicker(attribute_name, options = {}) template.content_tag("alchemy-datepicker", date_field, type: type) end + # Renders a simple_form input that displays a richtext editor + # + def richtext(attribute_name, options = {}) + text_area = input(attribute_name, options.merge(as: :text)) + template.content_tag("alchemy-tinymce", text_area) + end + # Renders a button tag wrapped in a div with 'submit' class. # def submit(label, options = {}) diff --git a/spec/libraries/forms/builder_spec.rb b/spec/libraries/forms/builder_spec.rb index dd7bb5654d..d4f8e705ca 100644 --- a/spec/libraries/forms/builder_spec.rb +++ b/spec/libraries/forms/builder_spec.rb @@ -26,21 +26,21 @@ end end - let(:template) do - double( - "Template", - controller: controller, - label: "