From 26310b1d76578f3e144354f07f12aa0afaed6b2c Mon Sep 17 00:00:00 2001 From: kylazath Date: Tue, 15 Feb 2022 09:29:04 +0100 Subject: [PATCH] Do not escape records hash values to allow using DT_RowAttr --- lib/ajax-datatables-rails/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ajax-datatables-rails/base.rb b/lib/ajax-datatables-rails/base.rb index 6f20a7e..73df486 100644 --- a/lib/ajax-datatables-rails/base.rb +++ b/lib/ajax-datatables-rails/base.rb @@ -98,7 +98,7 @@ def sanitize_data(data) if record.is_a?(Array) record.map { |td| ERB::Util.html_escape(td) } else - record.update(record) { |_, v| ERB::Util.html_escape(v) } + record.update(record) { |_, v| v.is_a?(Hash) ? v : ERB::Util.html_escape(v) } end end end