added the notification email method

This commit is contained in:
Tresor11
2020-07-02 22:51:37 +02:00
parent e64fa197aa
commit f2dd2c3bad
13 changed files with 88 additions and 34 deletions

View File

@@ -17,9 +17,7 @@ class FormsController < ApplicationController
def index
@forms = current_user.forms
if @forms.empty?
redirect_to new_form_url
end
redirect_to new_form_url if @forms.empty?
end
def create
@@ -33,6 +31,12 @@ class FormsController < ApplicationController
def edit
@form = current_user.forms.find_by!(token: params[:id])
puts "===========#{@form.notify_email}======================="
end
def notification
puts ''
@form = current_user.forms.find_by!(token: params[:id])
end
def update
@@ -55,6 +59,6 @@ class FormsController < ApplicationController
private
def form_params
params.require(:form).permit(:title, :thank_you_url, :backend_name, :google_spreadsheet_sheet, :airtable_table, :airtable_api_key, :airtable_app_key)
params.require(:form).permit(:title, :thank_you_url, :backend_name, :google_spreadsheet_sheet, :airtable_table, :airtable_api_key, :airtable_app_key, :notify_email)
end
end