Rails ActiveAdmin - get current_admin_user in utility navigation? -
the activeadmin docs can override utility navigation this:
activeadmin.setup |config| config.namespace :admin |admin| admin.build_menu :utility_navigation |menu| menu.add label: "activeadmin.info", url: "http://www.activeadmin.info", html_options: { target: :blank } admin.add_logout_button_to_menu menu # can pass priority & html_options link_to use end end end
it says default display includes current user's email address. how current user's email address? when try replacing menu.add label
value current_admin_user
error says current_admin_user
undefined. how access info signed in user config file? how activeadmin behind scenes?
config.namespace :admin |admin| admin.build_menu :utility_navigation |menu| menu.add :label => proc{ display_name current_active_admin_user }, :url => proc{ edit_admin_admin_user_path(current_active_admin_user) } ,#link_to current_active_admin_user, :id => 'current_user', :if => proc{ current_active_admin_user? } admin.add_logout_button_to_menu menu end end
Comments
Post a Comment