I just started learning ruby on rails coming from php and mysql worlds.
The tutorial are getting really confusing!!! According to this
http://guides.rubyonrails.org/migrations.html if you want to add foreign
key to a model it is not possible unless you use SQL format and
explicitly tell it where it is.
On the other-side, you have this
http://guides.rubyonrails.org/association_basics.html tutorial it is
possible by simply telling which field are related.
Now which tutorial i am suppose to believe??? Also if the association
together does it return the entire order rows or just one item of it.
and if i look in a db_migrate file why is there no id field already in
the file? Where does it get created?
Thanks but its a bit confusing coming from other language.