I’m dynamically generating menu options based on the currently logged
in user: current_user.
My menus are setup on the applicatin.rhtml file. The current_user is
defined in the application controller. But, attempting to assign it a
value while in the application controller results in an ‘undefined
@cu = ::User.find(session[:rbac_user_id]) || “not logged in”
<% if current_user.has_role?(“Admin”) %>
Apparently the current_user is not created by the time the
application.rhtml is rendered.
I think it might have something to do with the special nature of the
ApplicationController. But, I don’t fully understand what is
Is there a better way of building dynamic menus??
“Work, work, work…there is no satisfactory alternative.”
— E.Taft Benson