aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2018-02-13 15:07:29 -0500
committerJavan Makhmali <javan@javan.us>2018-02-13 15:07:29 -0500
commit2ae84d647feac338082175f581bd1ca0c33d003a (patch)
treef7e2f058fcf6689e27b2862877b49bef54f5e449 /lib
parentb79bf62196f1032d4a6f95799ced79cbbadad856 (diff)
downloadrails-2ae84d647feac338082175f581bd1ca0c33d003a.tar.gz
rails-2ae84d647feac338082175f581bd1ca0c33d003a.tar.bz2
rails-2ae84d647feac338082175f581bd1ca0c33d003a.zip
Initial Attachment rendering support
Diffstat (limited to 'lib')
-rw-r--r--lib/active_text/attachment.rb6
-rw-r--r--lib/active_text/content.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/active_text/attachment.rb b/lib/active_text/attachment.rb
index 870390f63e..e349c721b2 100644
--- a/lib/active_text/attachment.rb
+++ b/lib/active_text/attachment.rb
@@ -74,7 +74,11 @@ module ActiveText
end
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
def to_s
diff --git a/lib/active_text/content.rb b/lib/active_text/content.rb
index 0154cea17e..c9546fb4c5 100644
--- a/lib/active_text/content.rb
+++ b/lib/active_text/content.rb
@@ -46,7 +46,7 @@ module ActiveText
end
def to_html
- fragment.to_html
+ render_attachments(&:to_html).to_html
end
def to_s