Class: PDNS::DomainsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- PDNS::DomainsController
- Defined in:
- app/controllers/pdns/domains_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/pdns/domains_controller.rb', line 17 def create @domain = Domain.new(domain_params) if @domain.save render json: @domain, status: :created else render json: @domain.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
27 28 29 30 31 32 |
# File 'app/controllers/pdns/domains_controller.rb', line 27 def destroy set_domain @domain.destroy head :no_content end |
#index ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/pdns/domains_controller.rb', line 5 def index set_domains render json: @domains, status: :ok end |
#show ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/pdns/domains_controller.rb', line 11 def show set_domain render json: @domain, status: :ok end |