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

document_path, engine_klass, host_engine_path, material_path, root_path, settings, #whoami

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 :admin_resources, 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 :admin_resources, alert: t('.no_resources')
  end
end