Skip to content

Commit ba93b32

Browse files
committed
implicit plain when using a helper like link_to that returns an ActiveSupport::SafeBuffer
1 parent fc78b66 commit ba93b32

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/lib/matestack/ui/core/component_node.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ def initialize(component_instance, included_config)
2121

2222
def method_missing meth, *args, &block
2323
begin
24-
@component_instance.send(meth, *args, &block)
24+
if (result = @component_instance.send(meth, *args, &block)).kind_of? ActiveSupport::SafeBuffer
25+
plain result
26+
else
27+
result
28+
end
2529
rescue
2630
node_id = @node_start_id + 1
2731
@node_start_id = node_id

app/lib/matestack/ui/core/page_node.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def initialize(page_instance, included_config, url_params)
2222

2323
def method_missing meth, *args, &block
2424
begin
25-
@page_instance.send(meth, *args, &block)
25+
if (result = @page_instance.send(meth, *args, &block)).kind_of? ActiveSupport::SafeBuffer
26+
plain result
27+
else
28+
result
29+
end
2630
rescue
2731
node_id = @node_start_id + 1
2832
@node_start_id = node_id

0 commit comments

Comments
 (0)