2016-11-27 16 views
0

私はレールが新しく、既存のレールプロジェクトとGoogleドキュメントを統合しようとしています。ユーザーがボタンをクリックしたときに新しいGoogleドキュメントを作成したい同じもののための既存の宝石はありますか?どんな助けもありがとうGoogleドキュメントとレール

+0

そこにはたくさんの宝石があります。ちょうど 'google docs ruby​​'を検索してください。 GoogleドライブREST APIを試すこともできます:https://developers.google.com/drive/v3/web/quickstart/ruby –

答えて

2

ルビーgoogle-api-clientのための公式googleクライアント宝石を見てください。 ドキュメントからの使用例

require 'google/apis/drive_v2' 

Drive = Google::Apis::DriveV2 # Alias the module 
drive = Drive::DriveService.new 
drive.authorization = ... # See Googleauth or Signet libraries 

# Search for files in Drive (first page only) 
files = drive.list_files(q: "title contains 'finances'") 
files.items.each do |file| 
    puts file.title 
end 

# Upload a file 
metadata = Drive::File.new(title: 'My document') 
metadata = drive.insert_file(metadata, upload_source: 'test.txt', content_type: 'text/plain') 

# Download a file 
drive.get_file(metadata.id, download_dest: '/tmp/myfile.txt') 
関連する問題