Add search

This commit is contained in:
Justin Edmund 2020-10-18 22:24:50 -07:00
parent 132f676e2a
commit cf36fa9ffa
2 changed files with 9 additions and 5 deletions

View file

@ -1,10 +1,17 @@
class Api::V1::SearchController < Api::V1::ApiController
def index
logger.debug params
def weapons
if params[:query].present?
@weapons = Weapon.search(params[:query]).limit(10)
else
@weapons = Weapon.all
end
end
def summons
if params[:query].present?
@summons = Summon.search(params[:query]).limit(10)
else
@summons = Summon.all
end
end
end

View file

@ -1,3 +0,0 @@
collection @weapons, :object_root => false
extends 'weapons/base'