Hey there,

Im fairly new to rails and i've tried several tutorials which taught me
how to use the associatives on a basic level(has_many => belongs_to).

However i'm trying to figure out how i can create and execute some kind
of a join. My case is:
I've got a list of playing cards in my DB that are static.
Every user can have any of those cards, even multiple times. So my
tables would look something like this:

users
id = 1
name => "Bear Grylls"

id => 2
name => "Poopypants"
----------------------
cards
id => 1
name => "Captain Carl"

id => 2
name => "Whatever"
----------------------
usercardsjoin
card_id => 1
user_id => 1

card_id => 2
user_id=> 1

card_id => 1
user_id => 2
----------------------

Although i know how it should look like because of my experience with
PHP i have absolutely no clue how i can get this one to work.

Can any of you explain this or send me a link which handles this
particular issue?

Thanks in advance,

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to