Not quite sure how to choose the right instance variable in the model, but you could give almost any instance variable name, I am testing some cases and it seems like it is just looking for one that has the same model type when you don't specify it. to answer another question, you have many ways to make it just the same name as your instance variable, in your case
row :attr do link_to user.display_name, admin_user_path(user) end
you have
row :attr do |any_name| link_to any_name.display_name, admin_user_path(any_name) end
and the last method that I know you have two escenarios, one for your active_admin files (.rb)
or in custom .arb views, such as the form for custom collection_action (same, but direct access)
assigns[:user]
eg:
#views/admin/users/new_invitation.html.arb(arbre) or html.erb active_admin_form_for assigns[:user], :url => send_invitation_admin_users_path do |user| .... end form_for assigns[:user], :url => send_invitation_admin_users_path do |user| .... end semantic_form_for assigns[:user], :url => send_invitation_admin_users_path do |user| .....
As I said, I'm not sure how active_admin deals with instance variables, but at least you have a few options, welcome
source share