<%= error_messages_for 'role' %>

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

<%= f.check_box :assignable %>

<%=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 %>
<%= check_all_links 'role_form' %>