Sha256: c453b67cf6eb71c0f2703664373f5f9a238db9b0f65a2105a9c7575b20cb97ab

Contents?: true

Size: 369 Bytes

Versions: 6

Compression:

Stored size: 369 Bytes

Contents

module ActiveAdminAddons
  class ImageBuilder < CustomBuilder
    def render
      return nil if data.nil?
      raise "you need to pass a paperclip image attribute" unless data.respond_to?(:url)
      style = options.fetch(:style, :original)
      context.image_tag(data.url(style)) if data.file?
    end
  end
end

ActiveAdminAddons::ImageBuilder.create_view_methods

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
activeadmin_addons-1.9.0 lib/activeadmin_addons/addons/image_builder.rb
activeadmin_addons-1.8.3 lib/activeadmin_addons/addons/image_builder.rb
activeadmin_addons-1.8.2 lib/activeadmin_addons/addons/image_builder.rb
activeadmin_addons_rails6-1.7.2 lib/activeadmin_addons/addons/image_builder.rb
activeadmin_addons-1.7.1 lib/activeadmin_addons/addons/image_builder.rb
activeadmin_addons-1.7.0 lib/activeadmin_addons/addons/image_builder.rb