customizing subcategory name in dropdowns, yay:)
This commit is contained in:
@@ -2,4 +2,15 @@ class SubCategory < ActiveRecord::Base
|
|||||||
belongs_to :category
|
belongs_to :category
|
||||||
has_many :items
|
has_many :items
|
||||||
has_many :filter_criterias, as: :owner
|
has_many :filter_criterias, as: :owner
|
||||||
|
rails_admin do
|
||||||
|
object_label_method do
|
||||||
|
:custom_subcat_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def custom_subcat_name
|
||||||
|
cat = self.category.name
|
||||||
|
section = self.category.section.name
|
||||||
|
"#{section} -> #{cat} -> #{self.name}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user