<%= content_for(:title) %>
<%= link_to(
t("administrate.actions.edit_resource", name: page.page_title),
[:edit, namespace, page.resource],
class: "button",
) if valid_action?(:edit) && show_action?(:edit, page.resource) %>
<% account_user_page = Administrate::Page::Form.new(AccountUserDashboard.new, AccountUser.new) %>
<%= form_for([namespace, account_user_page.resource], html: { class: "form" }) do |f| %>
<% if account_user_page.resource.errors.any? %>
<%= t(
"administrate.form.errors",
pluralized_errors: pluralize(account_user_page.resource.errors.count, t("administrate.form.error")),
resource_name: display_resource_name(account_user_page.resource_name)
) %>
<% account_user_page.resource.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% end %>
<% account_user_page.attributes.each do |attribute| -%>
<% if attribute.name == "user" %>
<%= f.hidden_field('user_id', value: page.resource.id) %>
<% else %>
<%= render_field attribute, f: f %>
<% end %>
<% end -%>
<%= f.submit %>
<% end %>