Class: Datum::Admin::DataListsController

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

Instance Method Summary collapse

Instance Method Details

#add_itemObject



31
32
33
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 31

def add_item
  @data_list = DataList.new
end

#createObject



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

def create
  @data_list = DataList.new(data_list_params)
  @data_list.save

  redirect_to data_lists_url(type: @data_list.type)
end

#destroyObject



49
50
51
52
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 49

def destroy
  @data_list.destroy
  redirect_to data_lists_url, notice: 'Export file was successfully destroyed.'
end

#editObject



23
24
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 23

def edit
end

#indexObject



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

def index
  query = params.permit(:type).reverse_merge type: 'DataExport'
  @data_lists = DataList.default_where(query)
end

#just_runObject



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

def just_run

end

#newObject



9
10
11
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 9

def new
  @data_list = DataList.new(type: params[:type])
end

#rebuildObject



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

def rebuild
  @data_list.rebuild!

  redirect_back fallback_location: data_lists_url
end

#remove_itemObject



35
36
37
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 35

def remove_item

end

#showObject



20
21
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 20

def show
end

#updateObject



26
27
28
29
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 26

def update
  @data_list.update(data_list_params)
  redirect_to data_lists_url(type: @data_list.type)
end