I am using active admin for admin panel. On User show page I need to show his friends. I have two models User and Friend.
I want add pagination in the "friendship with panel" ie user.friends
block.
How can I add pagination on one panel? Here is the code that I am using.
show do
attributes_table do
row("Photo") { |user| image_tag(user.facebook_photo_url) }
rows :name, :sex,:city
end
panel 'Friendship with' do
table_for user.friends do
column "" do |friend|
(link_to image_tag(friend.facebook_photo_url('small')), admin_friend_path(friend)) + " ".html_safe + (link_to friend.name, admin_user_path(friend))
end
end
end
active_admin_comments
end
The Friend model is actually Facebook friends so I can't use self-referential joins on User model (so don't say use one model instead of two) and I have some other panels on the same page. I need to make sure every panel has their own pagination param name so that they don't conflict with each other.