【问题标题】:Capture customer uploaded image in admin dashboard?在管理仪表板中捕获客户上传的图像?
【发布时间】:2015-06-10 12:13:19
【问题描述】:

在我的应用程序中,我使用activeadminpaperclip(用于上传图片)。 我在admin/customer.rb中有以下代码

ActiveAdmin.register Customer do
  index do
    column :first_name
    column :email
    column :phone
    column :address
    column :created_at
    column :avatar
  end
end

【问题讨论】:

  • 显示你迄今为止尝试过的...?
  • 我什么都没尝试,我对 ruby​​ on rails 很陌生。只是我在customer.rb中添加了头像列
  • 在这个 Srack Overflow 问题中提到了完整的步骤,参考这个stackoverflow.com/questions/7078107/…

标签: ruby-on-rails paperclip activeadmin


【解决方案1】:
ActiveAdmin.register Customer do
  index do
    column :first_name
    column :email
    column :phone
    column :address
    column :created_at
    column :avatar do |customer|
      image_tag(customer.avatar.url(:thumb))
    end
  end
end

【讨论】:

    猜你喜欢
    • 2023-03-10
    • 1970-01-01
    • 2019-07-18
    • 2021-04-21
    • 2015-10-25
    • 2022-11-26
    • 1970-01-01
    • 2019-09-01
    • 2016-07-02
    相关资源
    最近更新 更多