Define a custom layout for submission thank you page
This commit is contained in:
parent
3dcd7314d0
commit
f2b264d787
@ -2,6 +2,7 @@ require 'google/apis/sheets_v4'
|
||||
require 'google/api_client/client_secrets'
|
||||
class FormsController < ApplicationController
|
||||
before_action :require_login, except: [:form]
|
||||
layout 'submission', only: [:form]
|
||||
|
||||
def new
|
||||
@form = current_user.forms.build
|
||||
@ -39,7 +40,9 @@ class FormsController < ApplicationController
|
||||
end
|
||||
|
||||
def form
|
||||
|
||||
@form = Form.find_by!(token: params[:id])
|
||||
render 'submissions/create'
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -2,6 +2,7 @@ require 'google/apis/sheets_v4'
|
||||
class SubmissionsController < ApplicationController
|
||||
skip_before_action :verify_authenticity_token
|
||||
wrap_parameters false
|
||||
layout 'submission', only: [:create]
|
||||
|
||||
def create
|
||||
@form = Form.find_by!(token: params[:form_id])
|
||||
|
21
app/views/layouts/submission.html.erb
Normal file
21
app/views/layouts/submission.html.erb
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Tinyform</title>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body class="has-text-centered-mobile">
|
||||
|
||||
<main>
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user