- url = report&.id.blank? ? reports_path : report_path(report) = form_with(model: report, id: dom_id(report), url: url, local: true ) do |form| - if report.errors.any? %h2= "#{pluralize(report.errors.count, "error")} prohibited this report from being saved:" %ul - report.errors.each do |error| %li= error.full_message %div{class: "space-y-2"} %div %div{class: "text-gray-500 text-xs"}= form.label :reason, "举报原因" %div= form.text_field :reason, class: "border p-1 w-full rounded-md" %div %div= form.submit "确认", class: "px-2 py-0.5 rounded-md bg-gray-800 text-white"