Class: Fosm::Admin::WebhooksController
- Inherits:
-
BaseController
- Object
- Fosm::ApplicationController
- BaseController
- Fosm::Admin::WebhooksController
- Defined in:
- app/controllers/fosm/admin/webhooks_controller.rb
Instance Method Summary collapse
Methods inherited from Fosm::ApplicationController
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/fosm/admin/webhooks_controller.rb', line 14 def create @webhook = Fosm::WebhookSubscription.new(webhook_params) if @webhook.save redirect_to fosm.admin_webhooks_path, notice: "Webhook created successfully." else @apps = Fosm::Registry.all render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/fosm/admin/webhooks_controller.rb', line 24 def destroy @webhook = Fosm::WebhookSubscription.find(params[:id]) @webhook.destroy redirect_to fosm.admin_webhooks_path, notice: "Webhook removed." end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/fosm/admin/webhooks_controller.rb', line 4 def index @webhooks = Fosm::WebhookSubscription.all.order(:model_class_name, :event_name) @apps = Fosm::Registry.all end |
#new ⇒ Object
9 10 11 12 |
# File 'app/controllers/fosm/admin/webhooks_controller.rb', line 9 def new @webhook = Fosm::WebhookSubscription.new @apps = Fosm::Registry.all end |