B
Bob Sanders
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?
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?