Prefill email if previous feedback for the session exists

This commit is contained in:
Petko Bordjukov 2017-10-23 00:46:56 +03:00
parent 6dac654313
commit 29dd83c7b4
2 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ class Public::ConferenceFeedbacksController < Public::ApplicationController
@feedback = current_conference.feedbacks.where(session_id: session.id).order(updated_at: :asc).last @feedback = current_conference.feedbacks.where(session_id: session.id).order(updated_at: :asc).last
else else
@feedback = current_conference.feedbacks.build @feedback = current_conference.feedbacks.build
@feedback.author_email = Feedback.where(session_id: session.id).order(updated_at: :asc).last.try(:author_email)
end end
end end

View File

@ -4,6 +4,7 @@ class Public::EventFeedbacksController < Public::ApplicationController
@feedback = event.feedbacks.where(session_id: session.id).order(updated_at: :asc).last @feedback = event.feedbacks.where(session_id: session.id).order(updated_at: :asc).last
else else
@feedback = event.feedbacks.build @feedback = event.feedbacks.build
@feedback.author_email = Feedback.where(session_id: session.id).order(updated_at: :asc).last.try(:author_email)
end end
end end