Merge pull request #458 from okriuchykhin/ok_SCI_957

Fix protocol table filtering by keywords [SCI-957]
This commit is contained in:
okriuchykhin 2017-01-27 14:19:53 +01:00 committed by GitHub
commit c6fe0003f4

View file

@ -190,9 +190,11 @@ class ProtocolsDatatable < AjaxDatatablesRails::Base
kws = record.protocol_keywords_str.split(", ")
res = []
kws.sort_by{ |word| word.downcase }.each do |kw|
res << "<a href='#' data-action='filter' data-param='#{kw}'>#{kw}</a>"
sanitized_kw = sanitize_input(kw)
res << "<a href='#' data-action='filter' " \
"data-param='#{sanitized_kw}'>#{sanitized_kw}</a>"
end
sanitize_input(res.join(', '))
res.join(', ')
end
end