mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Registrar: domain form autocompletes registrar and contact code
This commit is contained in:
parent
2b9923de49
commit
2ea24f42fc
8 changed files with 29 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
||||
before_action :init_domain, except: :new
|
||||
before_action :init_contacts_autocomplete_map, only: [:new, :edit, :create, :update]
|
||||
|
||||
def index
|
||||
authorize! :view, Depp::Domain
|
||||
|
@ -116,4 +117,9 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
|||
def init_domain
|
||||
@domain = Depp::Domain.new(current_user: depp_current_user)
|
||||
end
|
||||
|
||||
def init_contacts_autocomplete_map
|
||||
@contacts_autocomplete_map ||=
|
||||
current_user.registrar.contacts.pluck(:name, :code).map {|c| ["#{c.second} #{c.first}", c.second]}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue