Class: LesliVault::Descriptor::ActivitiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/lesli_vault/descriptor/activities_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

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

#destroyObject

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.full_messages.to_sentence)
    end
end

#editObject

GET /descriptor/activities/:id/edit



73
74
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 73

def edit
end

#indexObject

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

#listObject

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

#newObject

GET /descriptor/activities/new



69
70
# File 'app/controllers/lesli_vault/descriptor/activities_controller.rb', line 69

def new
end

#showObject

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

#updateObject

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