Forum: Ruby on Rails ACLSystem and session variables

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E4c4a05719644c37f02dc5181de7c8c5?d=identicon&s=25 Buntin, Seth - KATE (Guest)
on 2006-03-16 16:51
(Received via mailing list)
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
7cda78d70ab775710f6fa24e0a5b68db?d=identicon&s=25 Emin Hasanov (Guest)
on 2006-03-16 22:12
(Received via mailing list)
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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-03-16 22:15
(Received via mailing list)
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).
This topic is locked and can not be replied to.