Sha256: c515e456e408086b7dbc0b941382611f4a1fa6fbf762aaf7740956acc4a9d535

Contents?: true

Size: 416 Bytes

Versions: 6

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

# Extensions
class RowsExtController < RowsController

  def copy
    set_resource resource.dup
    resource.id = nil
    respond_to do |format|
      format.html { render action: :new }
    end
  end

  def multi_deletion
    items = params[:multi_tick] || []
    items -= ['']
    items.map { |id|  model_class.find_by_id(id.to_i).destroy }
    redirect_to action: :index
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rows_controller-3.0.5 app/controllers/rows_ext_controller.rb
rows_controller-3.0.4 app/controllers/rows_ext_controller.rb
rows_controller-3.0.3 app/controllers/rows_ext_controller.rb
rows_controller-3.0.1 app/controllers/rows_ext_controller.rb
rows_controller-3.0.0 app/controllers/rows_ext_controller.rb
rows_controller-2.2.2 app/controllers/rows_ext_controller.rb