Add form update

This commit is contained in:
bumi committed 2020-04-14 14:25:38 +02:00
1 parent 4821227895
commit f12238fbd4
4 files changed
+45 -15

No files matched your search

+13
View File
@@ -25,6 +25,19 @@ class FormsController < ApplicationController
end
end
def edit
@form = current_user.forms.find_by!(token: params[:id])
end
def update
@form = current_user.forms.find_by!(token: params[:id])
if @form.update(form_params)
redirect_to form_url(@form)
else
render :edit
end
end
def form
@form = Form.find_by!(token: params[:id])
end