mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Add contact show
This commit is contained in:
parent
1777a0e572
commit
2d2a12b7d0
12 changed files with 131 additions and 6 deletions
|
@ -3,15 +3,19 @@ class Admin::DomainsController < ApplicationController
|
|||
before_action :verify_deletion, only: [:destroy]
|
||||
|
||||
def new
|
||||
@domain = Domain.new
|
||||
owner_contact = Contact.find(params[:owner_contact_id]) if params[:owner_contact_id]
|
||||
@domain = Domain.new(owner_contact: owner_contact)
|
||||
params[:domain_owner_contact] = owner_contact
|
||||
end
|
||||
|
||||
def create
|
||||
@domain = Domain.new(domain_params)
|
||||
|
||||
if @domain.save
|
||||
flash[:notice] = I18n.t('shared.domain_added')
|
||||
redirect_to [:admin, @domain]
|
||||
else
|
||||
flash.now[:alert] = I18n.t('shared.failed_to_add_domain')
|
||||
render 'new'
|
||||
end
|
||||
end
|
||||
|
@ -27,7 +31,7 @@ class Admin::DomainsController < ApplicationController
|
|||
|
||||
def edit
|
||||
params[:registrar] = @domain.registrar
|
||||
params[:owner_contact] = @domain.owner_contact_code
|
||||
params[:domain_owner_contact] = @domain.owner_contact
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue