16 lines
415 B
Ruby
16 lines
415 B
Ruby
namespace '/search' do
|
|
get '' do
|
|
search_parameter = params[:query]
|
|
items = Item.where(Sequel.ilike(:name, "%#{search_parameter}%")).all()
|
|
licenses = License.where(Sequel.ilike(:name, "%#{search_parameter}%")).all()
|
|
|
|
results = items.concat(licenses)
|
|
|
|
erb :'search/list', :locals => {
|
|
:title => 'Search Results',
|
|
:results => results,
|
|
:query => search_parameter
|
|
}
|
|
end
|
|
end
|