end_of_association_chain object?

650 views
Skip to first unread message

faithfulgeek

unread,
Oct 12, 2008, 2:47:57 PM10/12/08
to resource_controller
Hey all,

I'm trying to learn all the ins and outs of resource_controller. I'm
not sure I understand the idea of the association_chain. It appears I
have access to an object in my controller called
end_of_association_chain. Judging from the code this is equivilant to
my model object that I can access by the instance variable @object. Is
this assumption correct? Can anyone help me understand the
association_chain concept and how my model in the end of it?

Thanks all!
Joe

Corey Haines

unread,
Oct 24, 2008, 2:04:03 PM10/24/08
to resource_controller
Hey, Joe!

I believe that it is for when you are using nested resources.

So, if I have something like
/owners/1/contributors/3/contributions

then the association chain goes: owners -> contributors ->
contributions

at each step of the way, it uses end_of_association chain to get to
the object that it asks for the children from. @owner.contributors,
@contributors.contributions

-Corey
Reply all
Reply to author
Forward
0 new messages