From 55ddb01dced5abd27bb72773fe998a4a7d7485ba Mon Sep 17 00:00:00 2001 From: alvaro-rrdt <101105168+alvaro-rrdt@users.noreply.github.com> Date: Fri, 20 Jun 2025 19:25:17 +0200 Subject: [PATCH] Fix: Use PATCH method for onboarding preferences form The form on the user onboarding preferences page was submitting with the POST HTTP method, which caused an ActionController::RoutingError because the /users/:id route only accepts PATCH/PUT for updates. This appeared to be a state-related bug where form_with was not correctly inferring the method from the persisted @user object during the initial onboarding flow. This change explicitly sets `method: :patch` on the form_with helper to ensure the correct verb is always used, resolving the routing error for all new users. Fixes #2398 --- app/views/onboardings/preferences.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/onboardings/preferences.html.erb b/app/views/onboardings/preferences.html.erb index a017f64d..5e865f96 100644 --- a/app/views/onboardings/preferences.html.erb +++ b/app/views/onboardings/preferences.html.erb @@ -63,7 +63,7 @@
<%= t(".preview") %>
- <%= styled_form_with model: @user, data: { turbo: false } do |form| %> + <%= styled_form_with model: @user, method: :patch, data: { turbo: false } do |form| %> <%= form.hidden_field :set_onboarding_preferences_at, value: Time.current %> <%= form.hidden_field :redirect_to, value: "goals" %> -- 2.53.0