Join GitHub today
Mongoid - Embedded Documents: undefined method `rails_admin_default_object_label_method' #1547
when I use rails_admin in combination with mongoid normally everything works fine but not with embedded documents.
Imaging this scenario:
class MainDoc include Mongoid::Document field :name, :type => String embeds_many :sub_docs accepts_nested_attributes_for :sub_docs attr_accessible :name, :sub_docs_attributes end class SubDoc include Mongoid::Document field :docKey, :type => String embedded_in :main_doc attr_accessible :docKey end
When I startup rails_admin with an empty mongodb database everything looks good. Even when I have added a MainDoc it looks correct.
When I add now a SubDoc to the MainDoc rails_admin starts searching for SubDoc#name or SubDoc#key for presenting the list of SubDocs. This property/method does not exists and so it throws the error
Of course it is possible to add
I have setup an example project SeriousM/rails_admin_mongoid_problem to demonstrate the behavior. Please run