app/controllers/spotlight/searches_controller.rb in blacklight-spotlight-0.20.3 vs app/controllers/spotlight/searches_controller.rb in blacklight-spotlight-0.21.0
- old
+ new
@@ -11,11 +11,11 @@
include Spotlight::Base
def create
@search.attributes = search_params
- @search.query_params = params.except(:exhibit_id, :search, *blacklisted_search_session_params).reject { |_k, v| v.blank? }
+ @search.query_params = query_params
if @search.save
redirect_to :back, notice: t(:'helpers.submit.search.created', model: @search.class.model_name.human.downcase)
else
redirect_to :back, alert: @search.errors.full_messages.join('<br>'.html_safe)
@@ -99,9 +99,13 @@
:long_description,
:default_index_view_type,
masthead_attributes: featured_image_attributes,
thumbnail_attributes: featured_image_attributes
)
+ end
+
+ def query_params
+ params.to_unsafe_h.with_indifferent_access.except(:exhibit_id, :search, *blacklisted_search_session_params).reject { |_k, v| v.blank? }
end
def featured_image_attributes
[:display, :source, :image, :remote_image_url, :document_global_id, :image_crop_x, :image_crop_y, :image_crop_w, :image_crop_h]
end