mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
19 lines
379 B
Ruby
19 lines
379 B
Ruby
class Admin::ContactsController < AdminController
|
|
load_and_authorize_resource
|
|
before_action :set_contact, only: [:show]
|
|
|
|
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
|
|
|
|
private
|
|
|
|
def set_contact
|
|
@contact = Contact.find(params[:id])
|
|
end
|
|
end
|