routes + links

Hi..

link problem..this is my setup

class Land < ActiveRecord::Base   belongs_to :werelddeel, :foreign_key => "werelddeel_id"   has_many :bestemming   set_table_name "landen"   set_primary_key "landcode"

  has_permalink :land_zoeknaam

  def to_param    land_zoeknaam   end end

class Bestemming < ActiveRecord::Base   has_many :land, :foreign_key => "landcode"   set_table_name "bestemmingen"   set_primary_key "bestemming_id"   has_permalink :stad_zoeknaam

  def to_param    stad_zoeknaam   end end

routes.rb

map.resources :werelddeel do |werelddeel|         werelddeel.resources :land do |land|           land.resources :bestemming      end end

rake routes werelddeel_land_bestemming GET /werelddeel/:werelddeel_id/land/:land_id/bestemming/:id

The view of my werelddeel (continents) to show the countries (landen). This works fine (http://www.goedkoop-vliegen.nu/werelddeel/europa)

<h2>Landen</h2> <ul> <% @landen.each do |land| %> <li><%= link_to land.naam, werelddeel_land_path(land.werelddeel, land)%></li> <% end %> </ul>

But what is the correct code for countries (landen)to show the destinations(bestemmingen)??

I tried this but with no succes..

<h2>Destinations</h2> <ul> <% @bestemmingen.each do |bestemming| %>

<li><%= link_to bestemming.naam, werelddeel_land_bestemming_path(land, bestemming)%></li>

<% end %> </ul>

What i am doing wrong...??

Grtz..remco

It's a little difficult battling through the language issue, but it appears that you're only supplying two parameters to the werelddeel_land_bestemming_path call. If that is singular (ie., identifying a particular country) then you need three because bestemming is nested within both werelddeel and land.