I'm gettings some strange stuff in my selectboxes that represent
belongs_to and has_many relationships:
#<Opleiding:0xb76dc6e0>
I'd really like this field(selectbox) to contain the name of the
'opleiding', instead of the object-id.
How can I override this?
Many thanks,
Ger Apeldoorn
Thanks,
Ger.
On Apr 16, 9:23 am, "Vorik" <goo...@gerapeldoorn.nl> wrote:
> I've found out that if I add a 'name' column for the referenced
> object, this gets put in the selectbox. However, my table has a 'naam'
> field. Is it possible to override this without changing the column
> name?
>
You want:
def to_label
self.naam
end
in your model.
Cheers,
Han Holl
Greetings,
Ger.