Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/lexxy/rich_text_area_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down