Class: Lcms::Engine::Admin::StandardsController

Inherits:
AdminController show all
Defined in:
app/controllers/lcms/engine/admin/standards_controller.rb

Constant Summary

Constants inherited from AdminController

AdminController::RE_GOOGLE_FOLDER

Instance Method Summary collapse

Methods inherited from AdminController

settings

Methods included from PathHelper

#dynamic_document_path, #dynamic_material_path, #dynamic_path

Instance Method Details

#editObject



10
# File 'app/controllers/lcms/engine/admin/standards_controller.rb', line 10

def edit; end

#indexObject



12
13
14
15
16
17
18
19
# File 'app/controllers/lcms/engine/admin/standards_controller.rb', line 12

def index
  @query = OpenStruct.new @query_params # rubocop:disable Style/OpenStructUse

  scope = Standard.order(:id)
  scope = scope.search_by_name(@query.name) if @query.name.present?

  @standards = scope.paginate(page: params[:page])
end

#updateObject



21
22
23
24
25
26
27
# File 'app/controllers/lcms/engine/admin/standards_controller.rb', line 21

def update
  if @standard.update(standard_params)
    redirect_to lcms_engine.admin_standards_path, notice: t('.success')
  else
    render :edit
  end
end