ActiveAdmin.register ColorGroup do index :download_links => [:csv] do selectable_column column(:id) { |it| auto_link it, it.id } column(:name) { |it| auto_link it, it.name } column(:slug) { |it| auto_link it, it.slug } column(:family) { |it| auto_link it.color_family, it.color_family.name if it.color_family.present? } column :asset_url column :order column :image do |it| if it.nil? "N/A" else # Use image_tag here... link_to sanitize("<img src=\"#{it.asset_url}\" class=\"cgs-img\" width=\"101\" height=\"24\" />"), it.asset_url end end actions end end
Friday, October 24, 2014
Images in Active Admin Index pages.
An example of how images can be embedded in Active Admin index pages in a Ruby on Rails application:
Labels:
Rails,
Ruby,
Ruby on Rails
Location:
San Francisco, CA, USA