簡體   English   中英

如何為Rails管理員禁用has_many_association?

[英]How to disable has_many_association for rails admin?

我注釋掉了has_many,但是在重新啟動Rails服務器后,與同一個導出頁面有很多

 config.model 'User' do

  #   # You can copy this to a 'rails_admin do ... end' block inside your user.rb model definition

  #   # Found associations:

      # configure :canvases, :has_many_association 
      # configure :level, :has_many_association 
      # configure :tags, :has_many_association 

  #   # Found columns:

      configure :id, :integer 
      configure :name, :string 
      configure :email, :string 
      configure :raw_info, :serialized 
      configure :created_at, :datetime 
      configure :updated_at, :datetime 

實際上,您應該刪除注釋以實施特定配置。

嘗試這個:

configure :canvases, :has_many_association do hide end  
configure :level, :has_many_association do hide end  
configure :tags, :has_many_association do hide end  

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM