New domain form

This commit is contained in:
Martin Lensment 2014-09-08 16:23:15 +03:00
parent 98cbae993d
commit 24e7beed5b
11 changed files with 66 additions and 1 deletions

View file

@ -0,0 +1,7 @@
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

View file

@ -1,6 +1,10 @@
class Admin::DomainsController < ApplicationController
before_action :set_domain, only: [:show]
def new
@domain = Domain.new
end
def index
@q = Domain.search(params[:q])
@domains = @q.result.page(params[:page])

View file

@ -0,0 +1,7 @@
class Admin::RegistrarsController < ApplicationController
def search
r = Registrar.arel_table
query_string = "%#{params[:query]}%"
render json: Registrar.where(r[:name].matches(query_string)).pluck(:name)
end
end