I have two models like so:
class Kid < ActiveRecord::Base
belongs_to :sex
attr_accessible :name
end
class Sex < ActiveRecord::Base
attr_accessible :description
has_many :kids
end
But for the life of me, I cannot figure out how to get the association to show up in the admin. When I go to edit a kid, I see a label for sex, but there is no dropdown, no hint whatsoever that RailsAdmin sees the association. It just shows the label name, a blank space and the word "optional" below.
I've searched through the dox over and over and over, yet I can't find a solution. I'm a noob, so it's possible I looked right over it and should be subject to ridicule.
I have not modified any other admin code.
The relation should be accessible in Kid, try to add sex_id to accessible attributes.
class Kid < ActiveRecord::Base
belongs_to :sex
attr_accessible :name, :sex_id
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With