cirandas.net

ref: master

app/views/profile_roles/_form.html.erb


<%= error_messages_for :role %>

<%= labelled_form_for :role, :url => (mode == :edit) ? {:action => 'update', :id => role} : {:action => 'create'} do |f| %>

  <%= required_fields_message %>

  <%= required f.text_field(:name) %>

  <% permissions.each do |key| %>
  

<%= _('%s Permissions:' % key) %>

<% ApplicationRecord::PERMISSIONS[key].keys.each do |p| %> <%= check_box_tag("role[permissions][]", p, role.has_permission?(p), { :id => p }) %> <%= content_tag(:label, permission_name(p), { :for => p }) %>
<% end %>
<% end %> <%= button_bar do %> <%= submit_button('save', (mode == :edit) ? _('Save changes') : _('Create role'), :cancel => {:action => 'index'} ) %> <% end %> <% end %>