20 lines
460 B
Ruby
20 lines
460 B
Ruby
|
class Raven
|
||
|
class SearchController
|
||
|
|
||
|
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
|
||
|
end
|