ruby on rails - How to map id to name in active admin index? -


i using active admin. have project , user model many many relationship between them. in user model have project_leader boolean column. , in project model have project_leader integer column. allowed select 1 project leader each project. , id of user project leader stored in project project_leader column. how map id of user name active admin index?

solved:

in project model defined method following.

def get_associated_user     p = self.project_leader     user = user.find(p).full_name   end   

and active_admin index called method object.get_associated_user


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -