<%= error_messages_for 'role' %>

<%= f.text_field :name, :required => true %>

<%=l(:label_permissions)%>: <% permissions = @permissions.group_by {|p| p.group_id } %> <% permissions.keys.sort.each do |group_id| %>
<%= l(Permission::GROUPS[group_id]) %> <% permissions[group_id].each do |p| %>
<%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %> <%= l(p.description.to_sym) %>
<% end %>
<% end %>
<%=l(:button_check_all)%> | <%=l(:button_uncheck_all)%>