【发布时间】:2015-12-03 09:35:03
【问题描述】:
当我获取图片的 url 时,我想在 Google 驱动程序中显示公用文件夹中的图片
Product.first.image.url
#=> ArgumentError: Missing access token.
我认为它没有获得谷歌驱动器路径。
产品型号
class Product < ActiveRecord::Base
has_attached_file :image,
:storage => :google_drive,
:google_drive_credentials => "#{Rails.root}/config/google_driver.yml",
:styles => { :medium => "300x300", :thumb => "100x100", :large => "800x600" },
:google_drive_options => {
:path => proc { |style| "#{style}_#{id}_#{image.original_filename}" },
:public_folder_id => '0B0VNyOkzIwUZQjFRU2NUX3pYSGs'
}
end
提前致谢
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-4 ruby-on-rails-3.2 google-drive-api