Forum: Ruby on Rails Automatically mapping content_columns?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel B. (Guest)
on 2006-01-03 23:19
(Received via mailing list)
Hi all,

Quick setup - I've got a table Foo.  Foo has a foreign key (bar_id) to
the
table Bar.  The Bar table has an "id" and "name" column.  Assume a 1:1
relationship.

The issue I'm trying to resolve (or rather, be lazy about) is with
regards to
Foo.content_columns.  By default it doesn't pickup the foreign key. What
I'm
wondering is if there's a convenient way to have content_columns
automatically
pick up both the column name and value that I'm after in the parent
table.  Or
is that just something I have to work out manually in the view or
controller,
or by redefining content_columns?

I don't want to just use Foo.columns, because that will give two values
I don't
want - the "bar_id" column name and the corresponding integer, neither
of which
I want displayed in a view.

If this is all covered by the content_columns documentation somewhere,
just
point me to it (I didn't see anything in the Agile book).

Regards,

Dan
This topic is locked and can not be replied to.