I am trying to autocomplete a search, the only issues is i am fetching two information. I am following the tutorial here http://railscasts.com/episodes/102-auto-complete-association-revised
Here the issues
def index
@titles = Event.order(:title).where("title like ?", "%#{params[:term]}%")
@customers = Customer.order(:first_name).where("first_name like ?", "%#{params[:term]}%")
render json: @titles.map(&:title)
render json: @customers.map(&:title)
end
If both contain something how can i return both objects.