internetee-registry/app/controllers/admin/contacts_controller.rb
2014-09-08 16:23:15 +03:00

7 lines
223 B
Ruby

class Admin::ContactsController < ApplicationController
def search
c = Contact.arel_table
query_string = "%#{params[:query]}%"
render json: Contact.where(c[:code].matches(query_string)).pluck(:code)
end
end