render NitroKit::SettingsSection.new(
title: "Profile",
description: "Public details shown to workspace members.",
id: "gallery-settings-section-validation"
) do |section|
section.status NitroKit::Alert.new(variant: :destructive, id: "gallery-settings-section-validation-status") do |alert|
alert.title("Profile was not saved")
alert.description("Correct the highlighted name and email fields.")
end
section.form do
form_with(url: "#profile", scope: :profile, builder: NitroKit::FormBuilder, id: "gallery-settings-section-validation-form") do |form|
form.group do
form.field(:name, label: "Display name", value: "", errors: [ "Display name can't be blank" ], required: true)
form.field(:email, as: :email, label: "Email", value: "not-an-email", errors: [ "Email is invalid" ], required: true)
form.submit("Save profile")
end
end
end
end