Class: Dcm4chee::Api::V1::ApplicationEntitiesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- Dcm4chee::ApplicationController
- BaseController
- Dcm4chee::Api::V1::ApplicationEntitiesController
- Defined in:
- app/controllers/dcm4chee/api/v1/application_entities_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create a new application entity.
-
#destroy ⇒ Object
Delete an application entity.
-
#index ⇒ Object
List the application entities.
-
#update ⇒ Object
Update an application entity.
Instance Method Details
#create ⇒ Object
Create a new application entity
96 97 98 99 100 |
# File 'app/controllers/dcm4chee/api/v1/application_entities_controller.rb', line 96 def create entity = Dcm4chee::ApplicationEntity.create_by_service(params[:application_entity]) render json: entity, status: :created end |
#destroy ⇒ Object
Delete an application entity
169 170 171 172 173 174 |
# File 'app/controllers/dcm4chee/api/v1/application_entities_controller.rb', line 169 def destroy entity = Dcm4chee::ApplicationEntity.get!(params[:id]) entity.destroy_by_service head :ok end |
#index ⇒ Object
List the application entities
39 40 41 42 43 |
# File 'app/controllers/dcm4chee/api/v1/application_entities_controller.rb', line 39 def index entities = Dcm4chee::ApplicationEntity.all(order: [:id.desc]) respond_with application_entities: entities end |
#update ⇒ Object
Update an application entity
153 154 155 156 157 158 |
# File 'app/controllers/dcm4chee/api/v1/application_entities_controller.rb', line 153 def update entity = Dcm4chee::ApplicationEntity.get!(params[:id]) entity.update_by_service(params[:application_entity]) render json: entity, status: :ok end |