diff --git a/app/controllers/concerns/search/query_terms_scoped.rb b/app/controllers/concerns/search/query_terms_scoped.rb deleted file mode 100644 index 11b88cdf2..000000000 --- a/app/controllers/concerns/search/query_terms_scoped.rb +++ /dev/null @@ -1,12 +0,0 @@ -module Search::QueryTermsScoped - extend ActiveSupport::Concern - - included do - before_action :set_query_terms - end - - private - def set_query_terms - @query_terms = params[:q] - end -end diff --git a/app/controllers/searches/queries_controller.rb b/app/controllers/searches/queries_controller.rb index f6b474baa..5dae4b1c6 100644 --- a/app/controllers/searches/queries_controller.rb +++ b/app/controllers/searches/queries_controller.rb @@ -1,8 +1,6 @@ class Searches::QueriesController < ApplicationController - include Search::QueryTermsScoped - def create - Current.user.remember_search(@query_terms) + Current.user.remember_search(params[:q]) head :ok end end diff --git a/app/controllers/searches_controller.rb b/app/controllers/searches_controller.rb index ad9f7a690..b36d0b0d7 100644 --- a/app/controllers/searches_controller.rb +++ b/app/controllers/searches_controller.rb @@ -1,8 +1,8 @@ class SearchesController < ApplicationController - include Search::QueryTermsScoped, Turbo::DriveHelper + include Turbo::DriveHelper def show - if card = Current.user.accessible_cards.find_by_id(@query_terms) + if card = Current.user.accessible_cards.find_by_id(params[:q]) @card = card else perform_search @@ -11,7 +11,7 @@ class SearchesController < ApplicationController private def perform_search - set_page_and_extract_portion_from Current.user.search(@query_terms) + set_page_and_extract_portion_from Current.user.search(params[:q]) @recent_search_queries = Current.user.search_queries.order(updated_at: :desc).limit(10) end end