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
|
||||
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
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
collection @weapons, :object_root => false
|
||||
|
||||
extends 'weapons/base'
|
||||
Loading…
Reference in a new issue