Class: Lcms::Engine::Admin::AccessCodesController
Constant Summary
Lcms::Engine::Admin::AdminController::RE_GOOGLE_FOLDER
Instance Method Summary
collapse
settings
Methods included from PathHelper
#dynamic_document_path, #dynamic_material_path, #dynamic_path
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 9
def create
@access_code = AccessCode.new(permitted_params)
if @access_code.save
redirect_to lcms_engine.admin_access_codes_path, notice: t('.success')
else
render :new
end
end
|
#destroy ⇒ Object
18
19
20
21
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 18
def destroy
@access_code.destroy
redirect_to lcms_engine.admin_access_codes_path, notice: t('.success')
end
|
#edit ⇒ Object
23
24
25
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 23
def edit
@url = lcms_engine.admin_access_code_path(@access_code)
end
|
#index ⇒ Object
27
28
29
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 27
def index
@access_codes = AccessCode.order(code: :asc).paginate(page: params[:page])
end
|
#new ⇒ Object
31
32
33
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 31
def new
@access_code = AccessCode.new
end
|
#update ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'app/controllers/lcms/engine/admin/access_codes_controller.rb', line 35
def update
if @access_code.update(permitted_params)
redirect_to lcms_engine.admin_access_codes_path, notice: t('.success')
else
@url = lcms_engine.admin_access_code_path(@access_code)
render :edit
end
end
|