Sha256: 55210728cf4e64c7e2f97411d9d2eb7169d177b560906889ed6c62eb5f734305

Contents?: true

Size: 706 Bytes

Versions: 7

Compression:

Stored size: 706 Bytes

Contents

module ActiveAdmin
  module Views

    # = Index as a Block
    #
    # If you want to fully customize the display of your resources on the index
    # screen, Index as a Block allows you to render a block of content for each
    # resource.
    #
    #     index :as => :block do |product|
    #       div :for => product do
    #         h2 auto_link(product.title)
    #         div do
    #           simple_format product.description
    #         end
    #       end
    #     end
    #
    class IndexAsBlock < ActiveAdmin::Component

      def build(page_config, collection)
        collection.each do |obj|
          instance_exec(obj, &page_config.block)
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
andrewroth_activeadmin-0.3.4 lib/active_admin/views/index_as_block.rb
activeadmin-0.3.4 lib/active_admin/views/index_as_block.rb
activeadmin-0.3.3 lib/active_admin/views/index_as_block.rb
activeadmin-0.3.2 lib/active_admin/views/index_as_block.rb
activeadmin-0.3.1 lib/active_admin/views/index_as_block.rb
activeadmin-0.3.0 lib/active_admin/views/index_as_block.rb
nsm-activeadmin-0.2.2 lib/active_admin/views/index_as_block.rb