app/views/curupira/roles/show.html.erb in curupira-0.1.3 vs app/views/curupira/roles/show.html.erb in curupira-0.1.4
- old
+ new
@@ -20,18 +20,20 @@
</div>
<div id="user_groups">
<h3>Usuários vinculados</h3>
- <ul>
- <% @role.group_users.group(:group_id).each do |gu| %>
- <h4>Grupo <%= link_to gu.group.name, gu.group %></h4>
- <% @role.group_users.where(group_id:gu.group_id).each do |group_user|%>
- <ul>
- <li><%= link_to group_user.user.name, group_user.user %></li>
- </ul>
+ <% if @role.group_users.present? %>
+ <ul>
+ <% @role.group_users.group(:group_id).each do |gu| %>
+ <h4>Grupo <%= link_to gu.group.name, gu.group %></h4>
+ <% @role.group_users.where(group_id:gu.group_id).each do |group_user|%>
+ <ul>
+ <li><%= link_to group_user.user.name, group_user.user %></li>
+ </ul>
+ <% end %>
<% end %>
- <% end %>
- </ul>
+ </ul>
+ <% end %>
</div>
<%= link_to "Voltar", roles_path %>