Class: Goldberg::RolesController
Instance Method Summary
collapse
Methods included from Controller
included
#copy, #six_local_auto_login
#active_scaffold_render_secure_download, #assign_names_with_active_scaffold, #render_with_active_scaffold, #search_generic_view_paths?
Instance Method Details
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 31
def create
@role = Role.new(params[:role])
if @role.save
Role.rebuild_cache
flash[:notice] = 'Role was successfully created.'
redirect_to :action => 'list'
else
foreign
render :action => 'new'
end
end
|
61
62
63
64
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 61
def destroy
Role.find(params[:id]).destroy
redirect_to :action => 'list'
end
|
43
44
45
46
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 43
def edit
@role = Role.find(params[:id])
foreign
end
|
9
10
11
12
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 9
def index
list
render :action => 'list'
end
|
14
15
16
17
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 14
def list
@roles = Role.find(:all,
:order => 'name')
end
|
26
27
28
29
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 26
def new
@role = Role.new
foreign()
end
|
19
20
21
22
23
24
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 19
def show
@role = Role.find(params[:id])
@rps = RolesPermission.find_for_role(@role.id)
@roles = @role.get_parents
foreign
end
|
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/six-updater-web/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb', line 48
def update
@role = Role.find(params[:id])
if @role.update_attributes(params[:role])
Role.rebuild_cache
@role = Role.find(params[:id])
flash[:notice] = 'Role was successfully updated.'
redirect_to :action => 'show', :id => @role.id
else
foreign
render :action => 'edit'
end
end
|