Merge pull request #14 from bumi/form-partial

Add form update
This commit is contained in:
2020-04-15 15:32:23 +02:00
committed by GitHub
4 changed files with 45 additions and 15 deletions

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