fix shared import paging without query

This commit is contained in:
wvengen 2014-05-21 14:20:29 +02:00
parent d906a7342f
commit 16b78ba2a0
2 changed files with 2 additions and 1 deletions

View file

@ -14,6 +14,7 @@ module ArticlesHelper
# Flatten search params, used in import from external database
def search_params
return {} unless params[:q]
Hash[params[:q].map { |k,v| [k, (v.is_a?(Array) ? v.join(" ") : v)] }]
end
end

View file

@ -15,7 +15,7 @@
%tbody
- for article in @articles
%tr{id: "shared_article_#{article.id}"}
%td= highlight article.name, params[:q][:name_cont_all]
%td= highlight article.name, search_params[:name_cont_all]
%td= article.origin
%td= article.manufacturer
%td{title: article.note}= truncate(article.note, length: 11)