Sha256: de3d5f53abac6ebe44628657abb35be7bd185c9313355e8f01b88b253537fde7

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

# Customize the Show Page

Customize the show page is as simple as implementing the show block:

    ActiveAdmin.register Post do
      show do
        h3 post.title
        div do
          simple_format post.body
        end
      end
    end

The show block is rendered within the context of the view and uses the Arbre HTML DSL. You
can also render a partial at any point.

    ActiveAdmin.register Post do
      show do
        # renders app/views/admin/posts/_some_partial.html.erb
        render "some_partial"
      end
    end

If you'd like to keep the default active_admin look, you can also use "attributes_table":

    ActiveAdmin.register Ad do
      show do |ad|
        attributes_table do
          row :title
          row :image do
            image_tag(ad.image.url)
          end
        end
        active_admin_comments
      end
    end

You can customize the title of the object in the show screen.  The default is the resource name and the ID.  You can customize as follows:

    show :title => :name do
    end


Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
activeadmin-0.6.6 docs/6-show-pages.md
activeadmin-0.6.5 docs/6-show-pages.md
activeadmin-0.6.4 docs/6-show-pages.md
activeadmin-0.6.3 docs/6-show-pages.md
activeadmin-0.6.2 docs/6-show-pages.md
activeadmin-0.6.1 docs/6-show-pages.md
aa-rails4-0.6.0 docs/6-show-pages.md