Class: RowsExtController

Inherits:
RowsController show all
Defined in:
app/controllers/rows_ext_controller.rb

Overview

Extensions

Instance Method Summary collapse

Methods inherited from RowsController

#create, #destroy, #edit, #index, model_class, #new, #show, #update

Methods included from Rows::Utils

#resource_format

Methods included from Rows::Resources

#resource, #resources, #set_resource, #set_resources

Methods included from Rows::Model

#model_class, #model_name, #model_symbol, #model_symbol_plural

Instance Method Details

#copyObject



6
7
8
9
10
11
12
# File 'app/controllers/rows_ext_controller.rb', line 6

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

#multi_deletionObject



14
15
16
17
18
19
# File 'app/controllers/rows_ext_controller.rb', line 14

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