Use HTML5 validation for the URL

This commit is contained in:
Stanko K.R.
2025-09-15 17:29:40 +02:00
parent 5b3089e11e
commit 63e64a060d
3 changed files with 11 additions and 15 deletions
+4 -12
View File
@@ -17,24 +17,16 @@ class WebhooksController < ApplicationController
end
def create
@webhook = @collection.webhooks.new(webhook_params)
if @webhook.save
redirect_to @webhook
else
render :new, status: :unprocessable_entity
end
@webhook = @collection.webhooks.create!(webhook_params)
redirect_to @webhook
end
def edit
end
def update
if @webhook.update(webhook_params.except(:url))
redirect_to @webhook
else
render :edit, status: :unprocessable_entity
end
@webhook.update!(webhook_params.except(:url))
redirect_to @webhook
end
def destroy