Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial for creating rails models and scaffolds with foreign key relationships [closed]

Where can I find a good Rails newbie-friendly reference about generating rails models with foreign key relationships?

I've found some pages indicating that you should add has_many and belongs_to to the relevant models to specify these relationships, but haven't seen any instructions for getting the scaffolds to generate the correct controller and view code that would reflect these relationships.

like image 673
readonly Avatar asked Dec 12 '25 06:12

readonly


1 Answers

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

and check Chap 11 and 12 for Rails 3 and Rails 3.2 I hope you like those chaps and it is very nice concept for foreign key relationships

like image 53
AMIC MING Avatar answered Dec 14 '25 21:12

AMIC MING