added a condition for a correct re render

This commit is contained in:
Tresor11 2020-07-02 23:04:50 +02:00
parent f2dd2c3bad
commit 5065f620a2
1 changed files with 5 additions and 2 deletions

View File

@ -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