+
-
-
Document not loading? <%= link_to 'Open it here', DEMO_FORM.spreadsheet_url %>.
+
+
Document not loading? <%= link_to 'Open it here', GOOGLE_DEMO_FORM.spreadsheet_url %>.
diff --git a/config/initializers/demo.rb b/config/initializers/demo.rb
index 915b94c..4947248 100644
--- a/config/initializers/demo.rb
+++ b/config/initializers/demo.rb
@@ -1 +1,3 @@
-DEMO_FORM = Form.find_by(id: ENV['DEMO_FORM_ID'])
+GOOGLE_DEMO_FORM = Form.find_by(id: ENV['GOOGLE_DEMO_FORM_ID'])
+AIRTABLE_DEMO_FORM = Form.find_by(id: ENV['AIRTABLE_DEMO_FORM_ID'])
+AIRTABLE_DEMO_EMBED_URL = ENV['AIRTABLE_DEMO_EMBED_URL']
diff --git a/config/routes.rb b/config/routes.rb
index fcf270a..d977dd6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,7 +6,9 @@ Rails.application.routes.draw do
resources :submissions
end
# short link for submission file uploads
- get '/s/:form_id/:submission_id/:id' => 'file_uploads#show', as: :file_upload
+ # we add the filename as part of the URL which allows e.g. Airtable to identify and name the file properly
+ # the constraint makes sure that a . (dot) can be in the filename. e.g. cat.jpg
+ get '/s/:form_id/:submission_id/:id(/:filename)' => 'file_uploads#show', as: :file_upload, constraints: { filename: /[^\/]+/ }
# form post url to save new submissions
post '/s/:form_id' => 'submissions#create', as: :submission
@@ -21,7 +23,7 @@ Rails.application.routes.draw do
get '/logout' => 'sessions#destroy', as: :logout
get '/auth' => 'sessions#auth', as: :auth
- get '/demo' => 'home#demo', as: :demo
+ get '/demo(/:backend)' => 'home#demo', as: :demo
get '/contact' => 'home#contact', as: :contact
get '/help', to: redirect('https://www.notion.so/Tinyforms-Help-Center-04f13b5908bc46cfb4283079a3cb1149')
diff --git a/env.example b/env.example
index 70b5e82..ff2ac81 100644
--- a/env.example
+++ b/env.example
@@ -2,3 +2,6 @@ GOOGLE_CLIENT_ID=clientid
GOOGLE_CLIENT_SECRET=secret
GOOGLE_PROJECT_ID=projectid
LOCKBOX_MASTER_KEY=f7b18b63d3f7ec48fa78bab327cdf81b0969020f70dc16947b14572cde3e2b7d
+GOOGLE_DEMO_FORM_ID=1
+AIRTABLE_DEMO_FROM_ID=2
+AIRTABLE_DEMO_EMBED_URL=''