Class: UffizziCore::Api::Cli::V1::ProjectsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UffizziCore::Api::Cli::V1::ProjectsController
- Includes:
- ProjectsControllerModule
- Defined in:
- app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Delete a project.
-
#index ⇒ Object
Get projects of current user.
-
#show ⇒ Object
Get a project by slug.
Instance Method Details
#destroy ⇒ Object
Delete a project
42 43 44 45 46 |
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 42 def destroy resource_project.disable! head :no_content end |
#index ⇒ Object
Get projects of current user
17 18 19 20 21 |
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 17 def index projects = current_user.projects.active.order(updated_at: :desc) respond_with projects, each_serializer: UffizziCore::Api::Cli::V1::ShortProjectSerializer end |
#show ⇒ Object
Get a project by slug
30 31 32 |
# File 'app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb', line 30 def show respond_with resource_project end |