%= form_with(model: member, class: "space-y-8") do |form| %>
<% if member.errors.any? %>
<%= pluralize(member.errors.count, "error") %> prohibited this member from being saved:
<% member.errors.each do |error| %>
- <%= error.full_message %>
<% end %>
<% end %>
Basic Information
<%= form.label :name, class: "block text-sm font-medium text-gray-700 mb-2" %>
<%= form.text_field :name,
class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
placeholder: "Enter member name..." %>
Budget Role
<%= form.label :pays, "Contributing Member", class: "block text-sm font-medium text-gray-700" %>
Whether this member contributes financially to the household budget
<%= form.check_box :pays, class: "toggle-checkbox sr-only" %>
<%= link_to members_path, class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" do %>
Cancel
<% end %>
<%= form.submit class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 cursor-pointer" %>
<% end %>