Class: Backend::AdminsController
Instance Method Summary
collapse
#breadcrumb, #current_admin, #default_app_locale, #translate_notice
#crypt
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/backend/admins_controller.rb', line 17
def create
@admin = Admin.new allowed_params
if @admin.save
redirect_to backend_admins_path, notice: translate_notice(:added, :admin)
else
render :new
end
end
|
#destroy ⇒ Object
35
36
37
38
|
# File 'app/controllers/backend/admins_controller.rb', line 35
def destroy
@admin.destroy
redirect_to backend_admins_path, notice: translate_notice(:deleted, :admin)
end
|
#index ⇒ Object
5
6
7
|
# File 'app/controllers/backend/admins_controller.rb', line 5
def index
@admins = Admin.all
end
|
#new ⇒ Object
13
14
15
|
# File 'app/controllers/backend/admins_controller.rb', line 13
def new
@admin = Admin.new
end
|
#show ⇒ Object
9
10
11
|
# File 'app/controllers/backend/admins_controller.rb', line 9
def show
redirect_to edit_backend_admin_path(@admin)
end
|
#update ⇒ Object
27
28
29
30
31
32
33
|
# File 'app/controllers/backend/admins_controller.rb', line 27
def update
if @admin.update_attributes allowed_params
redirect_to backend_admins_path, notice: translate_notice(:changes_saved)
else
render :edit
end
end
|