Class: Cbac::GenericRolesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/cbac/copy_files/controllers/generic_roles_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /create



18
19
20
21
22
# File 'lib/generators/cbac/copy_files/controllers/generic_roles_controller.rb', line 18

def create
  @role = Cbac::GenericRole.new(role_params)
  @role.save
  redirect_to :action => "index"
end

#deleteObject

POST /delete



25
26
27
28
29
# File 'lib/generators/cbac/copy_files/controllers/generic_roles_controller.rb', line 25

def delete
  @role = Cbac::GenericRole.find(params[:id])
  @role.delete
  redirect_to :action => "index"
end

#indexObject

GET /index GET /index.xml



7
8
# File 'lib/generators/cbac/copy_files/controllers/generic_roles_controller.rb', line 7

def index
end

#updateObject

POST /update



11
12
13
14
15
# File 'lib/generators/cbac/copy_files/controllers/generic_roles_controller.rb', line 11

def update
  @role = Cbac::GenericRole.find(params[:id])
  @role.update_attributes(role_params)
  redirect_to :action => "index"
end