From 16b78ba2a0c5e1934c6c4d2a3bfbcd19b274b7a8 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 21 May 2014 14:20:29 +0200 Subject: [PATCH] fix shared import paging without query --- app/helpers/articles_helper.rb | 1 + app/views/articles/_import_search_results.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/articles_helper.rb b/app/helpers/articles_helper.rb index d2042f1c..b299fe9b 100644 --- a/app/helpers/articles_helper.rb +++ b/app/helpers/articles_helper.rb @@ -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 diff --git a/app/views/articles/_import_search_results.haml b/app/views/articles/_import_search_results.haml index 57394027..3dba40b5 100644 --- a/app/views/articles/_import_search_results.haml +++ b/app/views/articles/_import_search_results.haml @@ -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)