From: James Britt Date: 2007-11-09T15:10:15+09:00 Subject: Re: user.roles -- How do you list the role names of the user? Bob Sanders wrote: > Hello, > > I want to list out the role names that belong to a user. I have > user.roles as the table, so I'm interested in the "name" column on that > roles table. If I want to separate the names using a comma [ e.g. using > .join(", ") ], how would I do it? > > For instance: > > <% for role in user.roles %><% role.name %><% end %> > > displays all of the roles of the user, but without the comma. There must > be a better way to do it (a less tedious way), and also separate them > with commas? > > Any idea? What happens when you do user.roles.join( ',' ) ? You may need to explain more about the object model. Is this part of an ORM library? Og? Sequel? ActiveRecord? -- James Britt "Tear it up and start again." - Anonymous