here is my code which is working fine but i want to add multiple attributes i.e last_name, city etc.
def autocomplete
render json: Doctor.search(params[:query], autocomplete: true, limit: 10).map(&:first_name)
end
I hope following explain my problem and you may got my point, Can i use following code.
def autocomplete
render json: Doctor.search(params[:query], autocomplete: true, limit: 10).map(&:first_name, :last_name, :city, :country)
end