mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Use BaseController in admin
This commit is contained in:
parent
cee4c84edd
commit
a63b989cd6
36 changed files with 1265 additions and 1215 deletions
|
@ -1,18 +1,20 @@
|
|||
class Admin::ZonefilesController < ApplicationController
|
||||
authorize_resource class: false
|
||||
# TODO: Refactor this
|
||||
module Admin
|
||||
class ZonefilesController < BaseController
|
||||
authorize_resource class: false
|
||||
# TODO: Refactor this
|
||||
|
||||
def create
|
||||
if DNS::Zone.origins.include?(params[:origin])
|
||||
def create
|
||||
if DNS::Zone.origins.include?(params[:origin])
|
||||
|
||||
@zonefile = ActiveRecord::Base.connection.execute(
|
||||
"select generate_zonefile('#{params[:origin]}')"
|
||||
)[0]['generate_zonefile']
|
||||
@zonefile = ActiveRecord::Base.connection.execute(
|
||||
"select generate_zonefile('#{params[:origin]}')"
|
||||
)[0]['generate_zonefile']
|
||||
|
||||
send_data @zonefile, filename: "#{params[:origin]}.txt"
|
||||
else
|
||||
flash[:alert] = 'Origin not supported'
|
||||
redirect_to :back
|
||||
send_data @zonefile, filename: "#{params[:origin]}.txt"
|
||||
else
|
||||
flash[:alert] = 'Origin not supported'
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue