Class: Dune::Api::V1::ProjectsController
Constant Summary
BaseController::MODULES
Instance Method Summary
collapse
#respond_with_pagination
#access_token, #check_authorization!, #current_user, #handle_forbidden, #handle_unauthorized, #require_admin!
Instance Method Details
#destroy ⇒ Object
30
31
32
33
34
35
36
|
# File 'app/controllers/dune/api/v1/projects_controller.rb', line 30
def destroy
project = Project.find(params[:id])
authorize project
project.push_to_trash!
head :no_content
end
|
#index ⇒ Object
14
15
16
|
# File 'app/controllers/dune/api/v1/projects_controller.rb', line 14
def index
collection
end
|
#show ⇒ Object
18
19
20
21
22
|
# File 'app/controllers/dune/api/v1/projects_controller.rb', line 18
def show
project = ::Project.find(params[:id])
authorize project
respond_with project, serializer: Dune::Api::ProjectSerializer
end
|
#update ⇒ Object
24
25
26
27
28
|
# File 'app/controllers/dune/api/v1/projects_controller.rb', line 24
def update
@project = Project.find(params[:id])
authorize @project
respond_with Project.update(params[:id], permitted_params)
end
|