I am new to Ruby/InstantRails. I am using InstantRails 2.0.2 with mysql
My application is named Area, it has two tables: people and country
Table people has two columns: name and tribe
Table country has two columns: location and population
In the models I have:
class People < ActiveRecord::Base
class Country < ActiveRecord::Base
I have country_id in the people’s table.
I know I can do this:
<% @peoples.each do |people| %>
What I want to do is to display location on country\index.html.erb
<% @countries.each do |country| %>
Then when I click on ‘location’ as a link, I want to display the ‘tribe’
along side with ‘population’ for that ‘location’ on
My question is, how can I reference a column from the people’s table
with a country’s object? I know it works the other round.