2016-02-12 41 views
0

我正在使用Rails管理員。我有三個型號:Rails管理器隱藏has_many嵌套形式的按鈕

class Tag < ActiveRecord::Base 
    has_many :tags_users, :dependent => :destroy 
end 

class TagsUser < ActiveRecord::Base 
    belongs_to :user_spot, :inverse_of => :tags_users 
    belongs_to :tag 
end 

class UserSpot < ActiveRecord::Base 
    has_many :tags_users, :inverse_of => :user_spot 
    accepts_nested_attributes_for :tags_users, :allow_destroy => true 
end 

,什麼是顯示:

Image

我想隱藏的按鈕「添加新標籤」和「編輯這個標籤」。我怎麼能這樣做?

回答

2

嘗試

field :tag do 
    inline_add false 
    inline_edit false 
end 
+0

我加入它config.model TagsUser在初始化/ rails_admin.rb和它的工作。謝謝! –