Add demo page

The demo page shows a form and an embedded google sheet side by side.
The form needs be be configured with a DEMO_FORM_ID environment variable.
This commit is contained in:
2020-04-12 00:59:43 +02:00
parent e68d4941f1
commit e46e68cc22
10 changed files with 163 additions and 18 deletions

View File

@@ -13,11 +13,11 @@ class Form < ApplicationRecord
# TODO: use counter_cache option on association
def submissions_count
submissions.count
@submissions_count ||= submissions.count
end
def last_submission_date
submissions.order(created_at: :desc).first&.created_at
@last_submission_date ||= submissions.order(created_at: :desc).first&.created_at
end
def deactivate!(reason = nil)