Contacts index view

This commit is contained in:
Martin Lensment 2014-09-18 17:15:54 +03:00
parent b4602e701c
commit 1777a0e572
4 changed files with 43 additions and 0 deletions

View file

@ -1,4 +1,10 @@
class Admin::ContactsController < ApplicationController
def index
@q = Contact.search(params[:q])
@contacts = @q.result.page(params[:page])
end
def search
render json: Contact.search_by_query(params[:q])
end