Forum: Ruby on Rails How to access attributes from a join table?

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.
Todd S. (Guest)
on 2006-03-19 19:06
I have a table "domains", "users" and a join table of "domains_users"
which has the domain_id, user_id as well as a userlevel_id attribute.

I know that in the model User class I can set the value of this
attribute with a function that calls:
domains.push_with_attributes(domain, :userlevel => 1)

but how do I access the userlevel field so that I can use it later on?
Todd S. (Guest)
on 2006-03-19 20:02
It looks like this will work...

@test = domain.attributes['userlevel_id']
This topic is locked and can not be replied to.