Database setup > a good startingpoint?

Hi,

I am a newbie to RoR, so i hope for that someone can reply with some
anwsers or url’s for futher reading.

My new project is to develop a travel-guide with some web 2.0 features.
I was just wondering how my database-schema must look like…i just want
to start basic…

Basic concept.

domain.com/europe/
domain.com/europe/netherlands/amsterdam
domain.com/europe/netherlands/amsterdam/hotels
domain.com/europe/netherlands/amsterdam/things-to-do
domain.com/europe/netherlands/amsterdam/restaurants
domain.com/europe/belgium/brussel
ect

domain.com/north-america/
domain.com/north-america/united-states/new-york/hotels
domain.com/north-america/united-states/los-angeles

domain.com/south-america/
domain.com/south-america/brazil/los-angeles
ect…

Each continent, country, city, hotels ect has is one page…with content

What is a good startingpoint??

Grtz…remco

Remco S. wrote:

Each continent, country, city, hotels ect has is one page…with content

What is a good startingpoint??

Grtz…remco

Work backwards from your problem domain

script/generate model Continent
script/generate model City
(etc… I think you can do them all in one line but I always do my models
by hand)

class Continent < ActiveRecord::Base
has_many :countries
end

class Country < ActiveRecord::Base
has_many :cities
belongs_to :continent
end

etc…

meanwhile, back on the farm: db/migration/001_create_countries.rb
def self_up
create_table :continents do |t|
t.column :name
t.column :number_of_shark_species_in_coastal_areas
end

etc…

that should get you started…

hth

ilan