The reason I can't add a nested link is because, i want to show the
items (Model D) from the controller of Model B. Model B controller
does not have a direct association with Model D.
Since the location thing did not work, I tried overriding a column in
Model B by making it a link to the list of items for Model D
def model_c_column(record)
link_to(h("Items"), "/model_cs/<model_c_id>/nested?
_method=get&associations=model_d")
end
This opens the correct form, but on a new page (not embedded/nested).
It seems there should be an easy way to do this, I just can't seem to
find it.
Thanks.
On Jan 13, 3:30 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Jueves, 13 de Enero de 2011 02:02:33 p k escribió:
>
> > I have the following relationship between my models:
>
> > Model_A has_many Model_C through=> Model_B
> > Model_C has_many Model_E through=> Model_D
> > On the activescaffold page for Model_A, I get the list of Model_Cs
> > associated with it.
>
> > Now for each Model_C, I want to add a custom link that shows me the
> > list of Model_Ds associated with that record. I added an inline custom
> > link that calls a method list_items which is as following:
>
> > def list_items
> > render :action=>'_nested', :location=>"/model_cs/<model_c_id>/
> > nested?_method=get&associations=model_d", :layout => false
> > end
>
> :location only set HTTP Location header. Why don't you add a nested link
> (config.nested.add_link) in Model C controller?
>
>
>
> > But, what I see is that an inline pane opens below the record for
> > model C with nothing in it.
>
> > Is location=> the correct way to do this?
>
> > Thanks.
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.