mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 02:09:39 +02:00
Adding nameservers to domain
This commit is contained in:
parent
24e7beed5b
commit
c24c8c7181
10 changed files with 69 additions and 8 deletions
21
app/controllers/admin/nameservers_controller.rb
Normal file
21
app/controllers/admin/nameservers_controller.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
class Admin::NameserversController < ApplicationController
|
||||
def new
|
||||
@domain = Domain.find_by(params[:id])
|
||||
@nameserver = @domain.nameservers.build
|
||||
end
|
||||
|
||||
def create
|
||||
@domain = Domain.find(params[:domain_id])
|
||||
if @domain.nameservers.create(nameserver_params)
|
||||
redirect_to [:admin, @domain]
|
||||
else
|
||||
render 'new'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def nameserver_params
|
||||
params.require(:nameserver).permit(:hostname, :ipv4, :ipv6)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue