mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
New domain form
This commit is contained in:
parent
98cbae993d
commit
24e7beed5b
11 changed files with 66 additions and 1 deletions
7
app/controllers/admin/contacts_controller.rb
Normal file
7
app/controllers/admin/contacts_controller.rb
Normal 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
|
|
@ -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])
|
||||
|
|
7
app/controllers/admin/registrars_controller.rb
Normal file
7
app/controllers/admin/registrars_controller.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue