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)