On Lunes, 28 de Diciembre de 2009 22:49:01 oliver barnes escribió:
> Hello,
>
> I've just installed AS into an existing app, and managed to get a
> basic listing going very quickly.
>
> I'm having trouble configuring associations, though. been searching
> docs, tutes and the google group for a couple of hours now, and
> haven't been able to figure them out.
>
> Here's what I have, stripped to essentials for this post:
>
> http://pastie.org/759295
>
> trying to do 2 things:
>
> one is to get a column for Physique on the People listing, with a link
> that will show Physique's content. with the current config, it ends up
> showing fields for Person, not Physique.
>
> the second is to show Physique's fields when showing a Person. right
> now the physique title appears, so the column is recognized, but it
> doesn't fetch any data.
>
> any pointers would be greatly appreciated - it'd be great if there
> were more concrete examples regarding dealing with associations in AS,
> from what I could see a lot of newcomers get stuck with them in the
> beginning...

1. If you remove set_link line you will get a link to edit the associated 
record. If you want to get a show link remove edit from 
actions_for_association_links (look at API: Column)
config.columns[:user].actions_for_association_links = [:show]

2. If Physique hasn't name, label or title method, you should define a to_label 
method.

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


Reply via email to