Hey mlttle-

You can create a new dog with:

def create
  @dog = Parent.find(params[:parent_id]).children.find(params
[:child_id]).dogs.create
end

The console is your best friend to quickly diagnose errors:

>> @record= parent.child.dog.build(params[:dog])
NoMethodError: undefined method `child' for #<Parent:0x22b6748>

.. becuase your parent model has many **children**

>> @record= parent.children.find(child).dogs.build(params[:dog])

Michael



--~--~---------~--~----~------------~-------~--~----~
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