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:
parent
b79bf62196
commit
2ae84d647f
3 changed files with 13 additions and 2 deletions
7
app/views/active_storage/blobs/_blob.html.erb
Normal file
7
app/views/active_storage/blobs/_blob.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<h2>Engine <code>blob/_blob</code>:</h2>
|
||||
|
||||
<%= debug blob %>
|
||||
|
||||
<figure>
|
||||
<%= image_tag rails_blob_path(blob) %>
|
||||
</figure>
|
|
@ -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
|
||||
|
|
|
@ -46,7 +46,7 @@ module ActiveText
|
|||
end
|
||||
|
||||
def to_html
|
||||
fragment.to_html
|
||||
render_attachments(&:to_html).to_html
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
Loading…
Reference in a new issue