added a condition for a correct re render
This commit is contained in:
parent
f2dd2c3bad
commit
5065f620a2
@ -31,7 +31,6 @@ class FormsController < ApplicationController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
@form = current_user.forms.find_by!(token: params[:id])
|
@form = current_user.forms.find_by!(token: params[:id])
|
||||||
puts "===========#{@form.notify_email}======================="
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def notification
|
def notification
|
||||||
@ -44,7 +43,11 @@ class FormsController < ApplicationController
|
|||||||
if @form.update(form_params)
|
if @form.update(form_params)
|
||||||
redirect_to form_url(@form)
|
redirect_to form_url(@form)
|
||||||
else
|
else
|
||||||
render :edit
|
if form_params[:notify_email]
|
||||||
|
render :notification
|
||||||
|
else
|
||||||
|
render :edit
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user