草庐IT

google-ajax-libraries

全部标签

ruby-on-rails - Google 跨客户端授权和 invalid_grant 错误

我目前正在开发用于GoogleApi跨客户端授权的Web组件,如本文所述。https://developers.google.com/identity/protocols/CrossClientAuth此外,我所处的环境是Rails,因此我正在使用本文中描述的google-api-clientgemhttps://developers.google.com/identity/protocols/OAuth2WebServer#handlingtheresponse授权代码是通过Android应用程序使用Web客户端ID获取的,并传递到WebAPI以进行交换。我使用gem和代码兑换如下a

ruby - Mailchimp API 未替换 mc :edit content sections (using ruby library)

我在用我提供的内容替换Mailchimp中的mc:edit内容区域时遇到问题。电子邮件已发送给订阅者,但所提供的内容均未添加到电子邮件中。谁能看出我可能哪里出错了?这是我正在使用的脚本:campaign=mailchimp.campaigns.create("regular",{"list_id"=>list_id,"subject"=>"EmailTest","from_email"=>"edward@somewhere.com","from_name"=>"Edward","to_name"=>"Thetoname","template_id"=>35089},{"sections

ruby - 如何在没有默认凭据文件的情况下授权 Google 服务帐户?

我有一个GoogleServiceAccount我的应用程序使用它从GoogleAnalytics检索数据。当我创建帐户时,我下载了一个client_secrets文件,其中包含通过OAuth授权所需的所有必要信息,并且我在名为GOOGLE_APPLICATION_CREDENTIALS的环境变量中记录了该文件的路径>根据Google'sdocumentation.我现在可以像这样获得经过身份验证的客户端:authorization=Google::Auth.get_application_default(scopes)此方法从文件中读取凭据,在本地工作,但我的应用程序托管在无法存储文

ruby-on-rails - 点击 Google Contacts API 时出现 "connection reset by peer"错误

我正在尝试使用GoogleContactsAPI将GoogleContacts拉入Rails应用程序。我已经完成了Oauth2握手,现在正在使用我的访问token请求protected资源。这是代码:uri=URI('https://www.google.com/m8/feeds/contacts/default/full')params={:client_id=>APP_CONFIG[:google_api_client_id],:access_token=>auth.access_token,"max-results".to_sym=>max_results}uri.query=U

ruby-on-rails - 如何在 Ajax 请求处理期间显示动画图标 - Rails 3

我正在尝试为每个ajax请求显示一个加载指示器,我在Rails3应用程序中工作。HTML:"loading-indicator",:style=>"display:none")%>CSS:#loading-indicator{position:absolute;left:10px;top:10px;}loading.js:我放在assest/javascripts/$(document).ready(function(){$(document).ajaxSend(function(event,request,settings){$('#loading-indicator').show(

ruby-on-rails - 如何使用 Rails 和 Paperclip 在 Google Cloud Storage 上存储照片?

到目前为止,我一直在使用AmazonS3来存储用户的文件。这里需要做的是:为存储桶指定AmazonS3凭据添加'aws-sdk'gem到Gemfile在模型中:has_attached_file:avatar,:styles=>{:big=>"100x100#",:thumb=>"25x25#"},:storage=>:s3,:s3_credentials=>"#{Rails.root}/config/s3.yml",:path=>":rails_root/public/users/:id/:style/:basename.:extension",:url=>"/users/:id/:

jquery - Rails Ajax 无法验证 CSRF token 的真实性

在我的Rails应用程序中,我在发送到api的ajax帖子中收到“警告:无法验证CSRFtoken真实性”。app/views/layouts/application.html.haml:!!!%html%head=stylesheet_link_tag"application",:media=>"all"=javascript_include_tag"application"=csrf_meta_tags%body=yieldajaxpost:$.ajax({url:'#{card_credits_path}',type:'POST',beforeSend:function(xhr)

ruby-on-rails - 使用 Google API 客户端,如何创建客户端

我正在努力使用GoogleAPI客户端:https://github.com/google/google-api-ruby-client具体来说,我想使用以下google_contacts_api.rb通过GoogleAPI客户端访问Google通讯录:https://gist.github.com/lightman76/2357338dcca65fd390e2我正在尝试像这样使用google_contacts_api.rb(x是有意的,实际上是正确的键):require'./lib/google_contacts_api.rb'auth=User.first.authenticati

jquery - Rails accepts_nested_attributes_for 与 f.fields_for 和 AJAX

我很好奇如何正确使用accepts_nested_attributes_for和f.fields_for。views/orders/new.html.erbDetailsviews/order_details/_details.html.erb$$$→|length:|width:|height:|weight:controllers/orders_controller.rb(我很确定这是错误的......非常感谢这里的任何帮助)defcreate@order=Order.create(params[:order])if@order.saveflash[:success]=

ruby-gmail : Uncaught exception: 534-5. 7.14 <https ://accounts. google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtMk

我可以手动登录我的帐户,但是当我使用ruby​​-gmail时,它会引发错误这是我的代码require'gmail'gmail=Gmail.new("myname@gmail.com","passwd")gmail.deliverdoto"rorocodeath@gmail.com"subject"HavingfuninPuertoRico!"text_partdobody"Textofplaintextmessage."endhtml_partdocontent_type'text/html;charset=UTF-8'body"Textofhtmlmessage."endadd_f