search for: forummembers

Displaying 2 results from an estimated 2 matches for "forummembers".

Did you mean: forummember
2006 Nov 04
0
Basic Q: Please help with iterating through an AR.find result
...e are two tables that track the users on this site. One table ''Forum'' has one entry per forum. The next table, ''ForumMember'' tracks each user''s status in each forum, if someone is a member of 10 forums, they have 10 ForumMember entries. Forum has_many ForumMembers, and ForumMember has_one Forum. I have a main page in which I list all the Forums that a user is a member of. I gather this data easily in my controller, with: def list @forums = Forum.find_by_user(@session[''user''].id) end However, I wish to extend this page and display t...
2006 Nov 04
0
Need help with iterating through a ''find'' result
...g the corresponding ForumMember entries. I do this all the time in Perl.. I plan to index the hash to get the status as I iterate through the forums in the view. So I''m trying to do something like this: def list @forums = Forum.find_by_user(@session[''user''].id) forummembers = ForumMember.find_by_userid(@session[''user''].id) forummembers.each {|fm| @forummember[fm.forumid] = fm} @userid = @session[''user''].id end But ruby won''t let me use the ''.each''. I''m hoping you will be able to follow wh...