<%= content_for :header_nav do %> <%= render "budgets/budget_nav", budget: @budget %> <% end %> <%= content_for :previous_path, budget_path(@budget) %> <%= content_for :cancel_path, budget_path(@budget) %>

Setup your budget

Enter your monthly earnings and planned spending below to setup your budget.

<%= styled_form_with model: @budget, class: "space-y-3", data: { controller: "budget-form" } do |f| %> <%= f.money_field :budgeted_spending, label: "Budgeted spending", required: true, disable_currency: true %> <%= f.money_field :expected_income, label: "Expected income", required: true, disable_currency: true %> <% if @budget.estimated_income && @budget.estimated_spending %>
<%= icon "sparkles" %>

Autosuggest income & spending budget

This will be based on transaction history. AI can make mistakes, verify before continuing.

<%= render DS::Toggle.new( id: "auto_fill", data: { action: "change->budget-form#toggleAutoFill", budget_form_income_param: { key: "budget_expected_income", value: sprintf("%.2f", @budget.estimated_income) }, budget_form_spending_param: { key: "budget_budgeted_spending", value: sprintf("%.2f", @budget.estimated_spending) } } ) %>
<% end %> <%= f.submit "Continue" %> <% end %>