Tutorial for creating rail and scaffold models with foreign key relationships

advertisements

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.


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