如何与“任何有链接的人”分享Rails 3 / gem'google_drive'

时间:2014-03-14 09:18:22

标签: ruby-on-rails ruby ruby-on-rails-3 google-drive-api

使用Rails 3.2.13&宝石'google_drive'

在我的控制器中:

session = GoogleDrive.login("*@gmail.com", "***")    
session.create_spreadsheet("My new sheet")
ws = session.spreadsheet_by_title('My new sheet').worksheets[0]
ws[2, 1] = "foi3o"
ws[2, 2] = "bar321643"
ws.save()

如何将分享设置为“有链接的任何人”?现在它只创建一个私人表格。

1 个答案:

答案 0 :(得分:2)

spreadsheet.acl.push({:scope_type => "default", :with_key => true, :role => "writer"})

gem的更多信息来源: https://github.com/gimite/google-drive-ruby/blob/master/lib/google_drive/acl.rb