Description Name Omnipotent System role Permissions Users
Uno dos yes false users, contr -
Edit Delete Show
tester tester no - - -
Edit Delete Show
Mere Mortal Human no true - -
Edit Delete Show
God Admin yes true - -
Edit Delete Show
A little Description Joao Paulo11111111 yes false - -
Edit Delete Show
test joe shmoe no - - -
Edit Delete Show
dfasdf asdfasd yes true - -
Edit Delete Show
lol lol no - - -
Edit Delete Show
boss any yes true - -
Edit Delete Show
Bon Vivant Some Name yes true - -
Edit Delete Show
gruppo uno Gruno yes true - -
Edit Delete Show
fgh gfh yes true - -
Edit Delete Show
Manager Mybizznet.com no true - -
Edit Delete Show
dsdfs dfdff no true contr -
Edit Delete Show
contador, ayudante pascual yes true - -
Edit Delete Show

Source

/controllers/roles_controller.rb

class RolesController < DemoController

  active_scaffold :roles do |config|
    config.theme = :blue
    config.actions.exclude :search
    config.actions << :field_search
  end

end

/models/role.rb

class Role < ActiveRecord::Base
  has_and_belongs_to_many :users
  has_and_belongs_to_many :permissions

  validates_presence_of :name
end

/helpers/roles_helper.rb

module RolesHelper
  include DemoHelper

  def omnipotent_column(record)
    record.omnipotent? ? 'yes' : 'no'
  end

  def omnipotent_form_column(record, name)
    check_box :record, :omnipotent, :name => name
  end
end