Class: Lcms::Engine::Admin::ResourceBulkEditsController

Inherits:
AdminController show all
Defined in:
app/controllers/lcms/engine/admin/resource_bulk_edits_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

#createObject



17
18
19
20
21
22
# File 'app/controllers/lcms/engine/admin/resource_bulk_edits_controller.rb', line 17

def create
  BulkEditResourcesService.new(@resources, resource_params).edit!
  resources_count_msg = t(:resources_count, count: @resources.count)
  notice = t('.success', count: @resources.count, resources_count: resources_count_msg)
  redirect_to lcms_engine.admin_resources_path, notice: notice
end

#newObject



9
10
11
12
13
14
15
# File 'app/controllers/lcms/engine/admin/resource_bulk_edits_controller.rb', line 9

def new
  if @resources.any?
    @resource = BulkEditResourcesService.new(@resources).init_sample
  else
    redirect_to lcms_engine.admin_resources_path, alert: t('.no_resources')
  end
end