Nested routes query and sanity check

Hi all,

I’ve been working on getting into Ruby on Rails, in particular for a new
job, here I hope to make use of it’s productivity gains…

So, after the books and screencast from peepcode, I’ve picked a starter
project. I now have a quick sanity check question on nested routes and
db flow before I go off down a path and cement false understandings.

My application consists of a traditional top down tree data flow, that
is a list of countries, each with many regions, which in turn have many
areas. Within the areas are the target items of interest to my
application, mountain crags, each having many routes.

My first pass at this app is a simple has_many and belongs_to

Ideally I would like to be able to view either by drilling down or
simply listing all/search filtered list at any level, that is they would
not have to go into each country, region, area, they could simply view
all crags and pick up from there to the routes they wish to see.

Ok, what I have so far is the basic routing I think, using edge.

  1. The above in one line :wink:
  2. Relvant routing section.
  3. Initial list of countries, selecting regions or the country to get
    specific information.
  4. the last link, that of the routes listing.

My question and thankyou for reading so far is, am I on the right path
for nested routing?

The next qustion is given I wish to enter at any point in the tree, so
presently I have: countries/2/regions/1/areas/1/crags/1/routes/1 as the

I wish to enter not that url but areas/ to see all areas for all
regions/countries. Preently I use a load_before to get relevant
information to the logical place. This is presently stopping me from
navigation to siteurl/areas/

On the pastie, see section 4 in the content for about. It displays
information for the crag you are presently on.

I know this is possibly not right in some way, I’ll figure it out late
one night no doubt, but has anybody got any pointers or advice?

Returning briefly to the crags table, is there any benefit in maintaing
multiple foreign keys for it’s parents, that is maintain a country_id,
region_id and area_id or should I reply upon the approach?

Please ask if I’ve not made anything crystal clear.