Method: CustomTable::ApplicationHelper#custom_table_batch_selector_check_box

Defined in:
app/helpers/custom_table/application_helper.rb

#custom_table_batch_selector_check_box(item, **params) ⇒ Object



480
481
482
483
484
485
486
487
488
# File 'app/helpers/custom_table/application_helper.rb', line 480

def custom_table_batch_selector_check_box item, **params

  # abort params.inspect

  params[:param] = "#{item.model_name.plural}[]" if params[:param].nil?
  params[:data] = {"toggle-target": "checkbox", "batch-actions-target": "checkbox", "action": "toggle#recalculateToggler batch-actions#refresh"}

  check_box_tag params[:param], item.id, (!params[item.model_name.plural.to_sym].blank?) && (params[item.model_name.plural.to_sym].include?(item.id.to_s)), params
end