Class: Account::Webhooks::Outgoing::EndpointsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /account/teams/:team_id/webhooks/outgoing/endpoints POST /account/teams/:team_id/webhooks/outgoing/endpoints.json



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

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

#destroyObject

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



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

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

#editObject

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



22
23
# File 'app/controllers/account/webhooks/outgoing/endpoints_controller.rb', line 22

def edit
end

#indexObject

GET /account/teams/:team_id/webhooks/outgoing/endpoints GET /account/teams/:team_id/webhooks/outgoing/endpoints.json



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

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

#newObject

GET /account/teams/:team_id/webhooks/outgoing/endpoints/new



18
19
# File 'app/controllers/account/webhooks/outgoing/endpoints_controller.rb', line 18

def new
end

#showObject

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



14
15
# File 'app/controllers/account/webhooks/outgoing/endpoints_controller.rb', line 14

def show
end

#updateObject

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



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

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