# frozen_string_literal: true Rails.application.routes.draw do # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html resources :forms do member do get :form get :setup end resources :submissions end # short link for submission file uploads # 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: %r{[^/]+} } # form post url to save new submissions post '/s/:form_id' => 'submissions#create', :as => :submission # short URL for form page get '/s/:id/form' => 'forms#form', :as => :form_submitter get 'oauth/callback', to: 'oauths#callback' get 'oauth/:provider', to: 'oauths#oauth', as: :auth_at_provider get '/signup' => 'sessions#signup', :as => :signup get '/login' => 'sessions#new', :as => :login get '/logout' => 'sessions#destroy', :as => :logout get '/auth' => 'sessions#auth', :as => :auth get '/demo(/:backend)' => 'home#demo', :as => :demo get '/contact', to: redirect('/#contact-us'), :as => :contact get '/help', to: redirect('https://www.notion.so/Tinyforms-Help-Center-04f13b5908bc46cfb4283079a3cb1149') get '/privacy', to: redirect('https://www.notion.so/Privacy-Policy-f4bd2d6c8e7742bbb9ca1c952aec0379') get '/terms', to: redirect('https://www.notion.so/Terms-and-Conditions-d73fd11089164eac91ede8ab4b4da5b3') get '/form-building-service', to: redirect('https://www.notion.so/Tinyforms-Help-Center-04f13b5908bc46cfb4283079a3cb1149') root 'home#index' end