Has many relationship with rails_admin

B

bradgonesurfing

Hi,

I'm using rails admin with the following model types

class Course
has_many :schedules
end

class Schedule
belongs_to :course
attr_readonly :course_id
end

When I'm editing a course instance I would like to see a button to create anew schedule. All I can see are the list of existing schedules but this isnot really a correct view. Schedules are owned by a Course and the course_id field on Schedule should be immutable.

What I should be able to do is delete schedules from a course and add new ones but not reassign schedules. Has anybody got this kind of association working with rails admin in a nice way.

Regards

Brad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top