Class: Account::Webhooks::Outgoing::DeliveriesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/account/webhooks/outgoing/deliveries_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /account/webhooks/outgoing/endpoints/:endpoint_id/deliveries POST /account/webhooks/outgoing/endpoints/:endpoint_id/deliveries.json



26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 26

def create
  respond_to do |format|
    if @delivery.save
      format.html { redirect_to [:account, @endpoint, :deliveries], notice: I18n.t("webhooks/outgoing/deliveries.notifications.created") }
      format.json { render :show, status: :created, location: [:account, @delivery] }
    else
      format.html { render :new, status: :unprocessable_entity }
      format.json { render json: @delivery.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /account/webhooks/outgoing/deliveries/:id DELETE /account/webhooks/outgoing/deliveries/:id.json



54
55
56
57
58
59
60
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 54

def destroy
  @delivery.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @endpoint, :deliveries], notice: I18n.t("webhooks/outgoing/deliveries.notifications.destroyed") }
    format.json { head :no_content }
  end
end

#editObject

GET /account/webhooks/outgoing/deliveries/:id/edit



21
22
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 21

def edit
end

#indexObject

GET /account/webhooks/outgoing/endpoints/:endpoint_id/deliveries GET /account/webhooks/outgoing/endpoints/:endpoint_id/deliveries.json



6
7
8
9
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 6

def index
  # if you only want these objects shown on their parent's show page, uncomment this:
  redirect_to [:account, @endpoint]
end

#newObject

GET /account/webhooks/outgoing/endpoints/:endpoint_id/deliveries/new



17
18
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 17

def new
end

#showObject

GET /account/webhooks/outgoing/deliveries/:id GET /account/webhooks/outgoing/deliveries/:id.json



13
14
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /account/webhooks/outgoing/deliveries/:id PATCH/PUT /account/webhooks/outgoing/deliveries/:id.json



40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/account/webhooks/outgoing/deliveries_controller.rb', line 40

def update
  respond_to do |format|
    if @delivery.update(delivery_params)
      format.html { redirect_to [:account, @delivery], notice: I18n.t("webhooks/outgoing/deliveries.notifications.updated") }
      format.json { render :show, status: :ok, location: [:account, @delivery] }
    else
      format.html { render :edit, status: :unprocessable_entity }
      format.json { render json: @delivery.errors, status: :unprocessable_entity }
    end
  end
end