Add form update
This commit is contained in:
1 parent
4821227895
commit
f12238fbd4
4 files changed
+45
-15
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user