mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 15:43:14 +01:00
Simplify search_params in search_controller
This commit is contained in:
parent
a82b1bd1b7
commit
8890354909
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ end
|
|||
|
||||
class SearchController < ApplicationController
|
||||
def index
|
||||
@search_definition = params[:paper_search].present? ? PaperSearch.new(search_params) : PaperSearch.new
|
||||
@search_definition = PaperSearch.new(search_params)
|
||||
@search_definition.sort_by ||= "score"
|
||||
|
||||
execute_search
|
||||
|
@ -29,7 +29,7 @@ class SearchController < ApplicationController
|
|||
end
|
||||
|
||||
def search_params
|
||||
params.require(:paper_search).permit(:query, :paper_type, :originator, :sort_by)
|
||||
params.fetch(:paper_search, {}).permit(:query, :paper_type, :originator, :sort_by)
|
||||
end
|
||||
|
||||
def extract_facets(name)
|
||||
|
|
Loading…
Reference in a new issue