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.
On May 9, 10:49 am, Remco Zwaan
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> 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
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---