Add search
This commit is contained in:
parent
132f676e2a
commit
cf36fa9ffa
2 changed files with 9 additions and 5 deletions
|
|
@ -1,10 +1,17 @@
|
||||||
class Api::V1::SearchController < Api::V1::ApiController
|
class Api::V1::SearchController < Api::V1::ApiController
|
||||||
def index
|
def weapons
|
||||||
logger.debug params
|
|
||||||
if params[:query].present?
|
if params[:query].present?
|
||||||
@weapons = Weapon.search(params[:query]).limit(10)
|
@weapons = Weapon.search(params[:query]).limit(10)
|
||||||
else
|
else
|
||||||
@weapons = Weapon.all
|
@weapons = Weapon.all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def summons
|
||||||
|
if params[:query].present?
|
||||||
|
@summons = Summon.search(params[:query]).limit(10)
|
||||||
|
else
|
||||||
|
@summons = Summon.all
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
collection @weapons, :object_root => false
|
|
||||||
|
|
||||||
extends 'weapons/base'
|
|
||||||
Loading…
Reference in a new issue