displaying name of drop-downs in foreign keys

3 views
Skip to first unread message

bret...@gmail.com

unread,
Jan 8, 2009, 3:54:20 PM1/8/09
to Streamlined
I've noticed that if I have a table with a foreign key, when adding or
editing a row in that table the drop-down for that foreign key will
display the name instead of the id if there is a name column in the
foreign table. Is there a way to specify another column other than
'name' to be displayed?

Bonefish

unread,
Jan 8, 2009, 4:20:36 PM1/8/09
to Streamlined
http://www.streamlinedframework.org/wiki/ColumnOptions
Look at "Using a custom method to render select options".

Regards,
Kerry

bret...@gmail.com

unread,
Jan 8, 2009, 4:22:42 PM1/8/09
to Streamlined
Yeah, I was just hoping there was a quicker way to define it since it
already has the support for the name column. I wanted to display the
email column, but it's not a pressing issue.

Thanks for the fast reply.

Bonefish

unread,
Jan 8, 2009, 4:29:48 PM1/8/09
to Streamlined
Within the list you can use show and edit view and just specify the
fields but I don't think that affects the drop-down on the edit form.
http://www.streamlinedframework.org/wiki/Relationships

Regards,
Kerry

bret...@gmail.com

unread,
Jan 8, 2009, 4:35:56 PM1/8/09
to Streamlined
Actually, it worked great! Not exactly documented, but I'd figure I'd
try it since :select inherits from the same base as everything else.
Anyways, here's what i did:

:edit_view => [:select, { :fields => [:email] }]

and voila!


On Jan 8, 4:29 pm, Bonefish <bonefish.fo...@gmail.com> wrote:
> Within the list you can use show and edit view and just specify the
> fields but I don't think that affects the drop-down on the edit form.http://www.streamlinedframework.org/wiki/Relationships
Reply all
Reply to author
Forward
0 new messages