Class: BrickLayer::AdministratorsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- BrickLayer::AdministratorsController
show all
- Defined in:
- app/controllers/brick_layer/administrators_controller.rb
Instance Method Summary
collapse
#authenticate, #current_administrator
Instance Method Details
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/brick_layer/administrators_controller.rb', line 14
def create
@administrator = BrickLayer::Administrator.new(params[:administrator])
if @administrator.save
flash[:success] = "You Created a New Administrator!"
redirect_to administrators_path
else
render "new"
end
end
|
#destroy ⇒ Object
34
35
36
37
38
|
# File 'app/controllers/brick_layer/administrators_controller.rb', line 34
def destroy
@administrator.destroy
flash[:success] = "Administrator Removed!"
redirect_to administrators_path
end
|
#index ⇒ Object
6
7
8
|
# File 'app/controllers/brick_layer/administrators_controller.rb', line 6
def index
@administrators = BrickLayer::Administrator.all
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/brick_layer/administrators_controller.rb', line 10
def new
@administrator = BrickLayer::Administrator.new
end
|
#update ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'app/controllers/brick_layer/administrators_controller.rb', line 25
def update
if @administrator.update_attributes(params[:administrator])
flash[:success] = "Administrator Updated!"
redirect_to administrators_path
else
render "edit"
end
end
|