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



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

def create
  respond_to do |format|
    if @endpoint.save
      format.html { redirect_to [:account, @team, :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



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

def destroy
  @endpoint.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @team, :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



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

def edit
end

#indexObject

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



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

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



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

def new
end

#showObject

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



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

def show
end

#updateObject

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



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

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