Add link to google spreadsheet

This commit is contained in:
bumi 2020-04-06 10:18:09 +02:00
parent 6e2d8dfc93
commit d55317fe43
2 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,10 @@ class Form < ApplicationRecord
validates_presence_of :title
def google_spreadsheet_url
"https://docs.google.com/spreadsheets/d/#{google_spreadsheet_id}/edit" if google_spreadsheet_id.present?
end
def create_spreadsheet
sheets = Google::Apis::SheetsV4::SheetsService.new
sheets.authorization = user.google_authorization

View File

@ -2,6 +2,9 @@
<p>
<%= submission_url(@form) %>
</p>
<p>
<%= link_to 'Google spreadsheet', @form.google_spreadsheet_url %>
</p>
<table>
<thead>
<tr>