How Do I Write Text to a Google Doc using Drive API's Ruby Client? -


hello ruby/rails/google community!

i'm looking correct way of making changes body of google doc stored in google drive using drive api ruby client.

let's i've required 'google/api_client', have authorized client , drive instance, , have starting template written in html.

i have no trouble creating fresh templates , multipart-uploading them drive using

@drive.files.insert

to join file metadata:

@file = @drive.files.insert.request_schema.new({             'title' => "#{time.now.strftime('%m_%d_%y_')}eod",             'description' => "the end of day log #{time.now.strftime('%m_%d_%y')}",             'mimetype' => 'text/html',             'parents' => [{'id' => folder_id}]         }) 

and html template represented by:

@media = google::apiclient::uploadio.new('eod_template.html', 'text/html')

having uploaded base template drive , capturing file_id, users able append text entries base template using form on rails site.

given existence of micropost model , form, suspect i'll writing method called on save appends submitted text google doc template can't find how in of drive api documentation.

i'm looking functionality identical apps-script appendtext(text) method found @ https://developers.google.com/apps-script/reference/document/text

anyone have clever solutions? documentation should read? perfect gem?

thanks mil time!

-b

i gather deafening silence such thing not (easily) possible. bummer! not deterred, implemented following workaround - hope works you, future readers. instead of writing posts document dynamically, let day's worth of posts pool in app until end of day, @ point write posts google doc @ once nokogiri. it's not great, front-end trickery whereby simulate feel of google doc, it's enough.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -