<%= form_with(
model: @record,
url: "",
method: "PATCH",
id: "htmlForm",
scope: "",
) do |form| %>
<% controller.get_fields.map(&:to_s).each do |f| %>
<%
# Don't provide form fields for associations or primary keys.
metadata = controller.class.fields_metadata[f]
next if !metadata || metadata[:kind] == "association" || metadata[:read_only]
%>
<% if metadata[:kind] == "rich_text" %>
<%= form.rich_text_area f %>
<% elsif metadata[:kind] == "attachment" %>
<% else %>
<% end %>
<% end %>
<%= form.submit "Submit", name: "", class: "btn btn-primary", style: "float: right" %>
<% end %>