Thanks for the reply. My models are correct, they work find at the
higher levels of the hierarchy.

On Sep 18, 9:01 am, Patrick Doyle <[email protected]> wrote:
> Could this be a pluralization issue?
> Did you set up your models as:
>
> class Parent < ActiveRecord::Base
>   has_many :children
> end
>
> class Parent < ActiveRecord::Base
>   has_many :children
>   belongs_to :parent
> end
>
> class Dog < ActiveRecord::Base
>   has_many :dogs
>   belongs_to :child
> end
>
> If so, then I would think that something like this might work:
>
> parent = Parent.find(params[:parent_id])
> child = parent.children.find(params[:child_id])
> @record= child.dogs.build(params[:dog])
>
> ...but I am still very much a RoR neophyte.  Everything I know about
> nested routes I learned 
> fromhttp://akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-f...,
> and I refer back to there each time I try to do it again.
>
> --wpd
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to