jam-cloud/app/controllers/api_search_controller.rb

18 lines
392 B
Ruby

class ApiSearchController < ApiController
# have to be signed in currently to see this screen
before_filter :api_signed_in_user
respond_to :json
def index
if (params[:userId] == nil)
@search = Search.search(params[:query])
# TODO: fix this hack to accommodate friend searches
else
@search = Search.search(params[:query], params[:userId])
end
end
end