Dropdown for association doesn't appear when form is nested #1279

Closed
johm opened this Issue Aug 12, 2012 · 2 comments

Comments

Projects
None yet
3 participants

johm commented Aug 12, 2012

I have a site with Courses, which have many CourseSessions, each of which belongs to a Location, i.e.

class Course < ActiveRecord::Base
has_many :course_sessions, :dependent => :destroy, :inverse_of => :course
  has_many :locations, :through => :course_sessions
  accepts_nested_attributes_for :course_sessions, :allow_destroy => true
end

class CourseSession < ActiveRecord::Base
  attr_accessible :course_session_start, :course_session_end, :course_id, :location_id,  :description
  belongs_to :course, :inverse_of => :course_sessions
  belongs_to :location, :inverse_of => :course_sessions
end

class Location < Active:Record::Base
  has_many :course_sessions, :inverse_of => :location
end

When I edit a CourseSession by itself, everything is fine: I get a drop down which lets me select the location.

But when I am editing a course, the nested forms for each CourseSession don't include the dropdown.

What gives? And how do I fix it?

bkappel commented Jun 14, 2013

Dear @johm, I have the same problem. Did you resolve the issue, if not what kind of solution did you use. Thx in advance.

Collaborator

mshibuya commented Jun 15, 2013

This is fixed in 37e927c, so upgrading RailsAdmin to 0.1.0 or later should solve this.

mshibuya closed this Jun 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment