From 5065f620a2081e33bdf761ee0ad37f36b784f677 Mon Sep 17 00:00:00 2001 From: Tresor11 Date: Thu, 2 Jul 2020 23:04:50 +0200 Subject: [PATCH] added a condition for a correct re render --- app/controllers/forms_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/forms_controller.rb b/app/controllers/forms_controller.rb index 5fd4648..3d1956b 100644 --- a/app/controllers/forms_controller.rb +++ b/app/controllers/forms_controller.rb @@ -31,7 +31,6 @@ class FormsController < ApplicationController def edit @form = current_user.forms.find_by!(token: params[:id]) - puts "===========#{@form.notify_email}=======================" end def notification @@ -44,7 +43,11 @@ class FormsController < ApplicationController if @form.update(form_params) redirect_to form_url(@form) else - render :edit + if form_params[:notify_email] + render :notification + else + render :edit + end end end