1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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,8 +74,12 @@ module ActiveText
end
def to_html
if attachable.respond_to?(:to_partial_path)
ApplicationController.render(self)
else
HtmlConversion.node_to_html(node)
end
end
def to_s
to_html

View file

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