Home > OS >  how to show image in active admin which is uploaded by carrier wave?
how to show image in active admin which is uploaded by carrier wave?

Time:11-17

  show do
    attributes_table do
      # byebug
      row :title
      row :description 
      row :image_url
      row :image_url do |img|
        if img.image_url.present?
          image_tag url_for(img.image_url), :size => "200x150" rescue nil
        end
      end       
      row :price
    end
  end
  

The error is as follows and I cannot figure out how to fix it - any more experienced people know what I am doing wrong?

CodePudding user response:

You can use below code:

row "Image" do
 image_tag(img.image_url, style: 'width: 200px; height: 150px;')
end

for more info you can check here:- https://activeadmin.info/6-show-pages.html

  • Related