2022-12-11 22:27:45 -05:00
|
|
|
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()
|
|
|
|
|
2022-12-17 23:43:26 -05:00
|
|
|
results = items.concat(licenses)
|
|
|
|
|
2022-12-11 22:27:45 -05:00
|
|
|
erb :'search/list', :locals => {
|
|
|
|
:title => 'Search Results',
|
2022-12-17 23:43:26 -05:00
|
|
|
:results => results,
|
2022-12-11 22:27:45 -05:00
|
|
|
:query => search_parameter
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|