search for: get_cur_user_rol

Displaying 1 result from an estimated 1 matches for "get_cur_user_rol".

Did you mean: get_cur_user_roles
2009 Apr 12
4
Can't get an Array function to be visible inside ApplicationHelper
...basic here. I am trying to call a function from my application layout that will return me a hash of the roles for the user currently signed in. Here is the simplified code I have in ApplicationHelper module class Array def to_h Hash[*enum_with_index.to_a.flatten] end end def get_cur_user_roles ["school_admin", "General2"].to_h end I call get_cur_user_roles from my layout file. When I bring up the web page I get an error that says undefined method `to_h'' for ["school_admin", "General2"]:Array However, if I capture the same code i...