简体   繁体   English

rails_admin has_and_belongs_to_many关联

[英]rails_admin has_and_belongs_to_many association

I have has_and_belongs_to_many relation in my models. 我的模型中具有has_and_belongs_to_many关系。 I have relation beetween models Hotels and HotelRoomsTypes 我在模型酒店和酒店房间类型之间有联系

class Hotel < ActiveRecord::Base
    attr_accessible hotel_room_types_attributes    
    has_and_belongs_to_many :hotel_room_types,:class_name => "HotelRoomType"
    accepts_nested_attributes_for :hotel_room_types, :allow_destroy => true
end

class HotelRoomType < ActiveRecord::Base
  attr_accessible :name
  has_and_belongs_to_many :hotels
end

when I am trying create association in rails_admin, I see following markup: 当我尝试在rails_admin中创建关联时,我看到以下标记: 在此处输入图片说明

after creation, rails_admin doesn't show associations to those model. 创建后,rails_admin不显示与这些模型的关联。 Anybody solved those problem or found patch to rails_admin? 有人解决了这些问题或找到了rails_admin的补丁程序吗?

I had downgraded from rails_admin 0.4.9 to 0.4.1 and problem solves. 我已经从rails_admin 0.4.9降级到0.4.1并解决了问题。

You can track progress of solution here: https://github.com/sferik/rails_admin/issues/1737 您可以在此处跟踪解决方案的进度: https : //github.com/sferik/rails_admin/issues/1737

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM