Class: Bulky::UpdatesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/bulky/updates_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



5
6
# File 'app/controllers/bulky/updates_controller.rb', line 5

def edit
end

#updateObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/bulky/updates_controller.rb', line 8

def update
  if params[:ids].blank?
    redirect_to bulky_edit_path(model: params[:model]), alert: I18n.t('flash.alert.blank_ids') and return
  end

  unless params[:bulk].is_a?(Hash)
    redirect_to bulky_edit_path(model: params[:model]), alert: I18n.t('flash.alert.bulk_not_hash') and return
  end

  Bulky.enqueue_update(model, ids, params[:bulk])
  redirect_to bulky_edit_path(model: params[:model]), notice: I18n.t('flash.notice.enqueue_update')
end