使用:local
作为本地主机中的存储不起作用。
我收到以下错误
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
我用来调用个人资料图片的代码
def profile_picture
picture = if self.image.attached? then self.image else Config.first.default_profile end
picture.variant(combine_options: { resize: "100x100>", gravity: 'Center', extent: "100x100", background: 'white'}).processed.service_url
end
视图中使用的代码
<%= image_tag current_admin.profile_picture, class: 'rounded-circle img-sidebar' %>
我已经尝试放
Rails.application.routes.default_url_options[:host] = "localhost"
当我将活动存储服务更改为google时,在localhost中运行良好。