Class: Datum::Admin::DataListsController
- Inherits:
-
BaseController
- Object
- BaseController
- Datum::Admin::DataListsController
- Defined in:
- app/controllers/datum/admin/data_lists_controller.rb
Instance Method Summary collapse
- #add_item ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #just_run ⇒ Object
- #new ⇒ Object
- #rebuild ⇒ Object
- #remove_item ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#add_item ⇒ Object
31 32 33 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 31 def add_item @data_list = DataList.new end |
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
23 24 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 23 def edit end |
#index ⇒ Object
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_run ⇒ Object
45 46 47 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 45 def just_run end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 9 def new @data_list = DataList.new(type: params[:type]) end |
#rebuild ⇒ Object
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_item ⇒ Object
35 36 37 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 35 def remove_item end |
#show ⇒ Object
20 21 |
# File 'app/controllers/datum/admin/data_lists_controller.rb', line 20 def show end |
#update ⇒ Object
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 |