Initial Attachment rendering support

This commit is contained in:
Javan Makhmali 2018-02-13 15:07:29 -05:00
parent b79bf62196
commit 2ae84d647f
3 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,7 @@
<h2>Engine <code>blob/_blob</code>:</h2>
<%= debug blob %>
<figure>
<%= image_tag rails_blob_path(blob) %>
</figure>

View File

@ -74,7 +74,11 @@ module ActiveText
end end
def to_html def to_html
HtmlConversion.node_to_html(node) if attachable.respond_to?(:to_partial_path)
ApplicationController.render(self)
else
HtmlConversion.node_to_html(node)
end
end end
def to_s def to_s

View File

@ -46,7 +46,7 @@ module ActiveText
end end
def to_html def to_html
fragment.to_html render_attachments(&:to_html).to_html
end end
def to_s def to_s