I installed Ruby on Rails Gem Active Admin and made association between tables.
Category
with fields (category_name:string)
with
SubCategory
with fields (sub_category_name:string, category_id:integer)
but when i view admin console for subcategory in drop down for categories instead of their name encrypted string is coming which refers to category id. Its like:
#<Category:0x698a648>
#<Category:0x6958998>
I want category name to be here. I know def to_s function can do it but in active admin gem i am not sure where to write this function.
Any Idea will be highly appreciated..
You could code the to_s method in the class and return the category name: