I am using the ACL System that is described on the Rails wiki and I have a quick question. I want to set the "role" as a session variable so that I can display certain navigation schemes and I was doing it like this: @session[:user][:role] = @user.roles When I print out this variable I get: #<Role:0x3262d80> How can I turn this into a readable value? I tried .to_i because I think it is an integer but that method isn't valid. Thanks. Seth
on 2006-03-16 17:51
on 2006-03-16 23:12
I don't know that system, but from the code it looks like @user.roles is a collection so you cannot simply print its value
on 2006-03-16 23:15
Buntin, Seth - KATE wrote: > #<Role:0x3262d80> > > > > How can I turn this into a readable value? I tried .to_i because I > think it is an integer but that method isn?t valid. If there's anything useful in there, @user.roles.inspect might show it. Then again, it might not. More useful I often find (as a check rather than as a presentation method) is YAMP::dump(obj).