【发布时间】:2020-03-20 00:27:27
【问题描述】:
我正在使用 ActionText 渲染一些富文本,由于某种原因,我在使用 actiontext 提供的部分向渲染的部分添加额外元素时受到限制
我需要将附加图像包裹在表格元素周围,以便它们可以在 Outlook 中正确呈现电子邮件。 ActionText 似乎总是忽略我放入的这个部分中的任何额外元素。有人知道为什么会发生这种情况以及是否有任何解决方法吗?
这是我的部分,表格元素被忽略:
/views/active_storage/blob/_blob.html.erb
<table>
<Tr>
<td>
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %> text-center">
<% if blob.representable? %>
<%= image_tag rails_representation_url(blob.representation(resize_to_limit: [600, 400])) %>
<% if caption = blob.try(:caption) %>
<figcaption class="attachment__caption text-center">
<%= caption %>
</figcaption>
<% end %>
<% end %>
</figure>
</td>
</Tr>
</table>
【问题讨论】:
标签: ruby-on-rails rails-activestorage actiontext