I'm working with google-drive-ruby and trying to get a the worksheet_index when Looping through them:
# Login
@session = GoogleDrive.login("email", "password")
# Get Specific Spreadsheet
@spreadsheets = @session.spreadsheet_by_key("spreadsheet_key")
So now i have access to my Spreadsheet on Google Drive and can loop through the Worksheets:
<% @spreadsheets.worksheets.each do |c| %>
<% c.title %>
<% end %>
All fine till now. My Problem is the actual Export
of the document.
class GoogleDrive::Spreadsheet
export_as_file(local_path, format = nil, worksheet_index = nil)
# Exports the spreadsheet in format as a local file.
so to identify a specific worksheet I need that worksheet_index
so i can export the right one.
And here I'm stuck, i searched for hours now but cant seem to find HOW i can get that worksheet_index
. Is there another way ? What am I missing?
Edit
I need to be able to pull a specific Worksheet in my Spreadsheet. (Every Worksheet has a 'google given' index_key)
@spreadsheets.worksheets.each_with_index do |c,worksheet_index|
? – Gaurav Shah