mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +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
|
class SearchController < ApplicationController
|
||||||
def index
|
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"
|
@search_definition.sort_by ||= "score"
|
||||||
|
|
||||||
execute_search
|
execute_search
|
||||||
|
@ -29,7 +29,7 @@ class SearchController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_params
|
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
|
end
|
||||||
|
|
||||||
def extract_facets(name)
|
def extract_facets(name)
|
||||||
|
|
Loading…
Reference in a new issue