I had (at one time) got this thing working but it doesnt’ seem to work
any more. I am trying to display a specific user menu depending on the
session variable. Here is what I have:
<% for @role in @session[:user][:role] %>
<% if @role.role_id == ‘1’ %>
“admin”, :action => “new_resource” %>
“admin”, :action => “list_new_resources” %>
“admin”, :action => “list_resources” %>
=> “list_users” %>
<% elsif @role.role_id == ‘2’ %>
“admin”, :action => “new_resource” %>
“admin”, :action => “list_new_resources” %>
“admin”, :action => “list_resources” %>
<% elsif @role.role_id == ‘3’ %>
“admin”, :action => “new_resource” %>
<% end %>
<% end %>
When I do @session[:user][:role].inspect I get:
[#“Administrator”, “info”=>“Can do anything.”, “role_id”=>“1”,
“id”=>“1”, “user_id”=>“1”}>]
Which is what I suspect. But my menu is blank and nothing is displayed.
Thanks for the help.
Seth