From 56743eb3800353b4704f4c5b1a97cb123d1a2019 Mon Sep 17 00:00:00 2001 From: Yu Le Date: Thu, 14 Mar 2024 22:30:46 +0800 Subject: [PATCH] Enable turbo refresh in layout/auth & Fix registrations controller create fail w/ status (#544) --- app/controllers/registrations_controller.rb | 2 +- app/views/layouts/auth.html.erb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 1071f0f6..40d13f16 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -19,7 +19,7 @@ class RegistrationsController < ApplicationController redirect_to root_path else flash[:alert] = t(".failure") - render :new + render :new, status: :unprocessable_entity end end diff --git a/app/views/layouts/auth.html.erb b/app/views/layouts/auth.html.erb index 2aaa4a52..284a06b5 100644 --- a/app/views/layouts/auth.html.erb +++ b/app/views/layouts/auth.html.erb @@ -23,6 +23,7 @@ <%= javascript_importmap_tags %> <%= hotwire_livereload_tags if Rails.env.development? %> + <%= turbo_refreshes_with method: :morph, scroll: :preserve %>