Description Name Omnipotent System role Permissions Users
Manage people t Manager yes true - -
Edit Delete Show
Manage people. Manager yes true - -
Edit Delete Show
Tester Tester no - - -
Edit Delete Show
test rrrr yes true - -
Edit Delete Show
MORENO MIGUEL yes true - -
Edit Delete Show
chick magnet mclovster no false - -
Edit Delete Show
sdfs admin yes false - -
Edit Delete Show
- admin no false - -
Edit Delete Show
Admin Role Admin yes true - -
Edit Delete Show
asdadadad sadasdada yes true - -
Edit Delete Show
dsadasdas dsaddsa no - - -
Edit Delete Show
Bilbo Bilbo yes true - -
Edit Delete Show
nathan nathan no - - -
Edit Delete Show
Bilbo Bilbo yes true - -
Edit Delete Show
nathan nathan no - - -
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