Class: Account::Webhooks::Outgoing::DeliveryAttemptsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts POST /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts.json



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

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

#destroyObject

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



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

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

#editObject

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



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

def edit
end

#indexObject

GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts.json



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

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

#newObject

GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts/new



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

def new
end

#showObject

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



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

def show
end

#updateObject

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



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

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