# Referencing joins

**URL:** <https://www.ruby-forum.com/t/referencing-joins/113853>\
**Category:** Rails\
**Created:** [September 5, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/referencing-joins/113853 "2007-09-05T17:05:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![3quid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/3/f08c70/32.png) [@3quid](https://www.ruby-forum.com/u/3quid)\
**Post date:** [September 5, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/referencing-joins/113853/1 "2007-09-05T17:05:51Z")

</div>

Hi,

Pretty much brand new to rails and am doing my first project with it.

I have created 3 tables. users, clubs and clubs\_users.

I have the join table (clubs\_users) gathering the user\_id and club\_id -  
as it should. The thing I am trying to do is, on the users account page,  
display all the clubs that they have created by referencing the user’s  
id in the join table.

I just can’t work out the syntax to do that. I realise it is a really  
simple task. Hopefully someone can shed some light on it for me?

Thanks guys,

3quid

---

<div class="post-metadata">

**Author:** ![3quid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/3/f08c70/32.png) [@3quid](https://www.ruby-forum.com/u/3quid)\
**Post date:** [September 5, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/referencing-joins/113853/2 "2007-09-05T17:16:11Z")

</div>

This is (usually) a good link for “created\_by” capabilities:  
[http://wiki.rubyonrails.org/rails/pages/Howto+Add+created\_by+and+updated\_by](http://wiki.rubyonrails.org/rails/pages/Howto+Add+created_by+and+updated_by)

However it’s down - google cache to the rescue:

[http://72.14.253.104/search?q=cache:5PvfMB1Z8EcJ:wiki.rubyonrails.org/rails/pages/Howto%2BAdd%2Bcreated\_by%2Band%2Bupdated\_by+ruby+on+rails+created\_by&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a](http://72.14.253.104/search?q=cache:5PvfMB1Z8EcJ:wiki.rubyonrails.org/rails/pages/Howto%2BAdd%2Bcreated_by%2Band%2Bupdated_by+ruby+on+rails+created_by&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a)

m
