2012-07-11 23 views

回答

2
RailsAdmin.config do |config| 
    config.model Team do 
    object_label_method do 
     :custom_label_method 
    end 
    end 

    def custom_label_method 
    "Team #{self.name}" 
    end 
end 

documentation

提煉如果你只是想從模型中使用的屬性,你可以通過它作爲被調用的方法...像:name將返回object.name作爲標籤。

相關問題