mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Domain editing
This commit is contained in:
parent
2a4c46e870
commit
4c4edd3747
6 changed files with 56 additions and 34 deletions
|
@ -1,5 +1,5 @@
|
|||
class Admin::DomainsController < ApplicationController
|
||||
before_action :set_domain, only: [:show]
|
||||
before_action :set_domain, only: [:show, :edit, :update]
|
||||
|
||||
def new
|
||||
@domain = Domain.new
|
||||
|
@ -28,6 +28,19 @@ class Admin::DomainsController < ApplicationController
|
|||
@domain.all_dependencies_valid?
|
||||
end
|
||||
|
||||
def edit
|
||||
params[:registrar] = @domain.registrar
|
||||
params[:owner_contact] = @domain.owner_contact_code
|
||||
end
|
||||
|
||||
def update
|
||||
if @domain.update(domain_params)
|
||||
redirect_to [:admin, @domain]
|
||||
else
|
||||
render 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_domain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue