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)
Landen
-
<% @landen.each do |land| %>
- <%= link_to land.naam, werelddeel_land_path(land.werelddeel, land)%> <% end %>
But what is the correct code for countries (landen)to show the
destinations(bestemmingen)??
I tried this but with no succes…
Destinations
-
<% @bestemmingen.each do |bestemming| %>
- <%= link_to bestemming.naam, werelddeel_land_bestemming_path(land, bestemming)%>
<% end %>
What i am doing wrong…??
Grtz…remco