I want to add some general information on active_admin top section.
For example, I want to render a partial at the top of the index page, so i can show something like
If I do it like I found in the documentation, It repeats for each element.
index do
render :partial=>'foo', :layout=>false
column :image_title
default_actions
end
I want to render :partial=>'foo', :layout=>false just ONCE.
Any help?
You can totally do this. You just might need to wrap it in an arbre component.
index do
panel "Foo", :id => "foo-panel" do
render :partial => "foo"
end
column :image_title
default_actions
end
class ::ActiveAdmin::Views::IndexAsAdminUser < ActiveAdmin::Views::IndexAsTable
def build(page_presenter, collection)
para "My custom text"
#or put _foo.html.erb to views/admin/admin_users
# render :partial=>'help', :layout=>false
super
end
end
ActiveAdmin.register AdminUser do
config.batch_actions = false
actions :index, :show
index as: :admin_user do #<---- as: :admin_user to load class ::ActiveAdmin::Views::IndexAsAdminUser
column :username
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
filter :username
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With