app/helpers/katalyst/content/editor_helper.rb in katalyst-content-0.2.0 vs app/helpers/katalyst/content/editor_helper.rb in katalyst-content-0.2.1
- old
+ new
@@ -23,9 +23,15 @@
# Generate items without their list wrapper, similar to form_with/fields
def content_editor_items(item:, container: item.container)
Editor::List.new(self, container).items(item)
end
+ # Generate a turbo stream fragment that will show structural errors to the user.
+ def content_editor_errors(container:, **options)
+ turbo_stream.replace(dom_id(container, :errors),
+ Editor::Errors.new(self, container).build(**options))
+ end
+
# Gene
def content_editor_new_item(item:, container: item.container, **options, &block)
Editor::NewItem.new(self, container).build(item, **options, &block)
end