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

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top