This is my code to get all user with certain role
<% users = User.all%>
<% users.each{ |user|%>
<% if not user.has_role? 'coach'%>
<% next%>
<% end%>
<option value="<%=user.id%>"><%=user.first_name%> </option>
<% }%>
It looks too much code for this simple task. Is there a better way to do this?
It's right on the readme https://github.com/EppO/rolify
User.with_role(:coach)