fix shared import paging without query
This commit is contained in:
parent
d906a7342f
commit
16b78ba2a0
2 changed files with 2 additions and 1 deletions
|
@ -14,6 +14,7 @@ module ArticlesHelper
|
||||||
|
|
||||||
# Flatten search params, used in import from external database
|
# Flatten search params, used in import from external database
|
||||||
def search_params
|
def search_params
|
||||||
|
return {} unless params[:q]
|
||||||
Hash[params[:q].map { |k,v| [k, (v.is_a?(Array) ? v.join(" ") : v)] }]
|
Hash[params[:q].map { |k,v| [k, (v.is_a?(Array) ? v.join(" ") : v)] }]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
%tbody
|
%tbody
|
||||||
- for article in @articles
|
- for article in @articles
|
||||||
%tr{id: "shared_article_#{article.id}"}
|
%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.origin
|
||||||
%td= article.manufacturer
|
%td= article.manufacturer
|
||||||
%td{title: article.note}= truncate(article.note, length: 11)
|
%td{title: article.note}= truncate(article.note, length: 11)
|
||||||
|
|
Loading…
Reference in a new issue