From 1e8838d98b779c9255364ebdcb378b438a4e2a83 Mon Sep 17 00:00:00 2001 From: Amy McCaughan <149846643+fivefootbot@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:43:07 -0500 Subject: [PATCH] Feedback and contact forms will auto-fill a user's email if they are logged in (#1282) --- app/controllers/contacts_controller.rb | 1 + app/controllers/feedback_controller.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 9e60c609b..9725ea9fa 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -4,6 +4,7 @@ class ContactsController < ApplicationController def new @contact = Contact.new + @contact.email = current_user.email if current_user.present? end def create diff --git a/app/controllers/feedback_controller.rb b/app/controllers/feedback_controller.rb index c03ecac77..749e75fd3 100644 --- a/app/controllers/feedback_controller.rb +++ b/app/controllers/feedback_controller.rb @@ -7,6 +7,7 @@ class FeedbackController < ApplicationController def new @feedback = Feedback.new + @feedback.email = current_user.email if current_user.present? end def create