Class: Datum::Admin::DataRecordsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/datum/admin/data_records_controller.rb

Instance Method Summary collapse

Instance Method Details

#add_itemObject



30
31
32
# File 'app/controllers/datum/admin/data_records_controller.rb', line 30

def add_item
  @data_record = DataRecord.new
end

#createObject



12
13
14
15
16
17
# File 'app/controllers/datum/admin/data_records_controller.rb', line 12

def create
  @data_record = DataRecord.new(data_record_params)
  @data_record.save

  redirect_to data_records_url(type: @data_record.type)
end

#destroyObject



45
46
47
48
# File 'app/controllers/datum/admin/data_records_controller.rb', line 45

def destroy
  @data_record.destroy
  redirect_to data_records_url, notice: 'Export file was successfully destroyed.'
end

#editObject



22
23
# File 'app/controllers/datum/admin/data_records_controller.rb', line 22

def edit
end

#indexObject



4
5
6
# File 'app/controllers/datum/admin/data_records_controller.rb', line 4

def index
  @data_records = DataRecord.page(params[:page])
end

#newObject



8
9
10
# File 'app/controllers/datum/admin/data_records_controller.rb', line 8

def new
  @data_record = DataRecord.new(type: params[:type])
end

#rebuildObject



38
39
40
41
42
43
# File 'app/controllers/datum/admin/data_records_controller.rb', line 38

def rebuild
  @data_record.columns = @data_record.config_columns
  @data_record.save

  redirect_back fallback_location: data_records_url
end

#remove_itemObject



34
35
36
# File 'app/controllers/datum/admin/data_records_controller.rb', line 34

def remove_item

end

#showObject



19
20
# File 'app/controllers/datum/admin/data_records_controller.rb', line 19

def show
end

#updateObject



25
26
27
28
# File 'app/controllers/datum/admin/data_records_controller.rb', line 25

def update
  @data_record.update(data_record_params)
  redirect_to data_records_url(type: @data_record.type)
end