Rystraum
Rystraum

Reputation: 2025

ActiveAdmin Sidebar Ordering in Index

When you add a sidebar in the index view, it shows up after the filter sidebar.

I'd like my own sidebar to appear before the filter sidebar.

Any ideas?

Upvotes: 1

Views: 252

Answers (1)

mmm
mmm

Reputation: 11

I wrote the following:

ActiveAdmin::Views::Pages::Base.class_eval do
        # Renders the sidebar
        def build_sidebar
          a = []
          sidebar_sections_for_action.collect do |section|
            a = [a, section].flatten.compact
          end   
          div id: "sidebar" do
            a.reverse.each do |section|
              sidebar_section(section)
            end
          end
        end
end

save the above in app/admin/active_admin_extensions.rb, good luck.

Upvotes: 1

Related Questions