Sha256: 94886f10a5d23e2104410ffd5b111e27a792a19c4cef6dec25155f3c371c352c

Contents?: true

Size: 1.21 KB

Versions: 61

Compression:

Stored size: 1.21 KB

Contents

# Sidebar Sections

To add a sidebar section to all the screen within a section, use the sidebar method:

    sidebar :help do
      "Need help? Email us at help@example.com"
    end

This will generate a sidebar section on each screen of the resource. With the block as
the contents of the section. The first argument is the section title.

You can also use Arbre syntax to define the content.

    sidebar :help do
      ul do
        li "Second List First Item"
        li "Second List Second Item"
      end
    end

Sidebar sections can be rendered on a specific action by using the :only or :except
options.

    sidebar :help, :only => :index do
      "Need help? Email us at help@example.com"
    end

If you want to conditionally display a sidebar section, use the :if option and
pass it a proc which will be rendered within the context of the view.

    sidebar :help, :if => proc{ current_admin_user.super_admin? }
      "Only for super admins!"
    end

If you only pass a symbol, Active Admin will attempt to locate a partial to render.

    # Will render app/views/admin/posts/_help_sidebar.html.erb
    sidebar :help

Or you can pass your own custom partial to render.

    sidebar :help, :partial => "custom_help_partial"

Version data entries

61 entries across 61 versions & 3 rubygems

Version Path
activeadmin-0.6.6 docs/7-sidebars.md
activeadmin-0.6.5 docs/7-sidebars.md
activeadmin-0.6.4 docs/7-sidebars.md
activeadmin-0.6.3 docs/7-sidebars.md
activeadmin-0.6.2 docs/7-sidebars.md
activeadmin-0.6.1 docs/7-sidebars.md
aa-rails4-0.6.0 docs/7-sidebars.md
lalala-4.0.0.dev.141 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.136 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.135 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.134 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.133 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.132 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.131 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.129 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.128 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.126 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.125 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.124 vendor/deps/active_admin/docs/7-sidebars.md
lalala-4.0.0.dev.123 vendor/deps/active_admin/docs/7-sidebars.md