Hi,
after hours of trying I am stuck with the following. I have a Class for
courses (called GdFb here) with multiple references to Class GdPerson
class GdFb < ActiveRecord::Base
belongs_to :va_plan,
:foreign_key => “va_plan”,
:class_name => “GdPerson”
belongs_to :va_org,
:foreign_key => “va_org”,
:class_name => “GdPerson”
and a Class for Persons:
class GdPerson < ActiveRecord::Base
has_many :gd_fbs
end
Now I want selection fields that allow me to edit the fields va_plan and
va_plan by selecting from existing entries in the GdPerson-Table.
I have tried many code snippets like
<% @personen = GdPerson.find(:all).collect { |c| [ c.name, c.id ] } %>
<%#= collection_select(‘gd_fb’, ‘va_plan’, @personen, :id, :name, {},
:multiple => false) %>
But none of them worked. Can someone help?
TIA