Class: Cms::Admin::WebhooksController
- Inherits:
-
BaseController
- Object
- BaseController
- Cms::Admin::WebhooksController
- Defined in:
- app/controllers/cms/admin/webhooks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 16 def create @webhook = current_site.webhooks.build(webhook_params) if @webhook.save redirect_to admin_webhooks_path, notice: t("cms.notices.webhook_created") else render :new, status: :unprocessable_content end end |
#destroy ⇒ Object
35 36 37 38 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 35 def destroy @webhook.destroy redirect_to admin_webhooks_path, notice: t("cms.notices.webhook_deleted") end |
#edit ⇒ Object
25 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 25 def edit; end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 8 def index @webhooks = current_site.webhooks.order(created_at: :desc) end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 12 def new @webhook = current_site.webhooks.build end |
#update ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/cms/admin/webhooks_controller.rb', line 27 def update if @webhook.update(webhook_params) redirect_to admin_webhooks_path, notice: t("cms.notices.webhook_updated") else render :edit, status: :unprocessable_content end end |