diff --git a/lib/lexxy/rich_text_area_tag.rb b/lib/lexxy/rich_text_area_tag.rb index 7f0ac4c96..112483081 100644 --- a/lib/lexxy/rich_text_area_tag.rb +++ b/lib/lexxy/rich_text_area_tag.rb @@ -24,13 +24,14 @@ def lexxy_rich_textarea_tag(name, value = nil, options = {}, &block) # Temporary: we need to *adaptarize* action text def render_custom_attachments_in(value) if value.respond_to?(:body) - if html = value.body_before_type_cast.presence + if html = value.body&.to_html.presence self.prefix_partial_path_with_controller_namespace = false if respond_to?(:prefix_partial_path_with_controller_namespace=) ActionText::Fragment.wrap(html).replace(ActionText::Attachment.tag_name) do |node| if node["url"].blank? attachment = ActionText::Attachment.from_node(node) node["content"] = render_action_text_attachment(attachment).to_json end + node end end