I use Active Admin gem for Ruby on Rails. I have modules Team and Coach, which have a has_many and belongs_to relationship.
class Team < ActiveRecord::Base
belongs_to :coach
end
class Coach < ActiveRecord::Base
has_many :teams
end
I figured out how to display first name and last name on index and show page (i did it like that:)
index do
column :name
column "Coach" do |team|
team.coach.firstname + " " + team.coach.lastname
end
default_actions
end
What i want is how to display first name and last name of coach in Team form (new and edit page) in dropdown menu? Please help me with this.