简体   繁体   中英

CSS of image in activeadmin in ruby on rails

For image of users I use Paperclip and for admin I use activeadmin. All is going fine but in activeadmin index page missing.png images are showing large. I want o set their height and width but doesn't find any solution how to set their css only for missing.png images.

Maybe this is buggy, but the idea should work.

if model.image.present?
  image_tag model.image.url(:thumb)
else
  image_tag model.image.url(:thumb), class: 'missing'
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM