Class: LesliVault::Descriptor::ActivitiesController
- Inherits:
-
ApplicationController
- Object
- Lesli::ApplicationLesliController
- ApplicationController
- LesliVault::Descriptor::ActivitiesController
- Defined in:
- app/controllers/lesli_vault/descriptor/activities_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /descriptor/activities.
-
#destroy ⇒ Object
DELETE /descriptor/activities/1.
-
#edit ⇒ Object
GET /descriptor/activities/:id/edit.
-
#index ⇒ Object
GET /descriptor/activities.
-
#list ⇒ Object
GET /descriptor/activities/list.json.
-
#new ⇒ Object
GET /descriptor/activities/new.
-
#show ⇒ Object
GET /descriptor/activities/:id.
-
#update ⇒ Object
PATCH/PUT /descriptor/activities/:id.
Instance Method Details
#create ⇒ Object
POST /descriptor/activities
77 78 79 80 81 82 83 84 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 77 def create descriptor_activity = Descriptor::ActivityServices.new(current_user, query).create(descriptor_activity_params) if descriptor_activity.successful? respond_with_successful(descriptor_activity.result) else respond_with_error(descriptor_activity.errors) end end |
#destroy ⇒ Object
DELETE /descriptor/activities/1
98 99 100 101 102 103 104 105 106 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 98 def destroy return respond_with_not_found unless @descriptor_activity if @descriptor_activity.destroy respond_with_successful else respond_with_error(@descriptor_activity.errors..to_sentence) end end |
#edit ⇒ Object
GET /descriptor/activities/:id/edit
73 74 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 73 def edit end |
#index ⇒ Object
GET /descriptor/activities
49 50 51 52 53 54 55 56 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 49 def index respond_to do |format| format.html {} format.json do respond_with_pagination(Descriptor::ActivityServices.new(current_user, query).index) end end end |
#list ⇒ Object
GET /descriptor/activities/list.json
39 40 41 42 43 44 45 46 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 39 def list respond_to do |format| format.html {} format.json do respond_with_successful(Descriptor::ActivityServices.new(current_user, query).list) end end end |
#new ⇒ Object
GET /descriptor/activities/new
69 70 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 69 def new end |
#show ⇒ Object
GET /descriptor/activities/:id
59 60 61 62 63 64 65 66 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 59 def show respond_to do |format| format.html {} format.json do return respond_with_successful(@descriptor_activity.show) end end end |
#update ⇒ Object
PATCH/PUT /descriptor/activities/:id
87 88 89 90 91 92 93 94 95 |
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 87 def update @descriptor_activity.update(descriptor_activity_params) if @descriptor_activity.successful? respond_with_successful(@descriptor_activity.result) else respond_with_error(@descriptor_activity.errors) end end |