Skip to content

Commit 5c61571

Browse files
committed
Explicitly define html_escape
In async actions the view context doesn't seem to be available, from where html_escape was called before. So we explicitly call out to it now. Also improved some error reporting, that before was just swalloing errors without a proper stacktrace or real error.
1 parent f03051d commit 5c61571

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

app/concepts/matestack/ui/core/page/page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def show(component_key=nil, only_page=false)
9494
begin
9595
render_child_component component_key
9696
rescue => e
97-
raise "Component '#{component_key}' could not be resolved."
97+
raise "Component '#{component_key}' could not be resolved, because of #{e},\n#{e.backtrace.join("\n")}"
9898
end
9999
end
100100
end

lib/matestack/ui/core/cell.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def template_options_for(_options)
2222
}
2323
end
2424

25-
# def html_escape(string)
26-
27-
# end
25+
def html_escape(string)
26+
ERB::Util.html_escape(string)
27+
end
2828
end
2929
end
3030
end

spec/usage/base/component_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ def response
345345
after_content = element.text
346346

347347
expect(before_content).not_to eq(after_content)
348-
349348
end
350349

351350
it "components can render dynamic content with vue.js involved if inherit from 'Matestack::Ui::DynamicComponent'" do

0 commit comments

Comments
 (0)