Class: Datum::Admin::DataRecordsController
- Inherits:
-
BaseController
- Object
- BaseController
- Datum::Admin::DataRecordsController
- Defined in:
- app/controllers/datum/admin/data_records_controller.rb
Instance Method Summary collapse
- #add_item ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #rebuild ⇒ Object
- #remove_item ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#add_item ⇒ Object
30 31 32 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 30 def add_item @data_record = DataRecord.new end |
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
22 23 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 22 def edit end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 4 def index @data_records = DataRecord.page(params[:page]) end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 8 def new @data_record = DataRecord.new(type: params[:type]) end |
#rebuild ⇒ Object
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_item ⇒ Object
34 35 36 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 34 def remove_item end |
#show ⇒ Object
19 20 |
# File 'app/controllers/datum/admin/data_records_controller.rb', line 19 def show end |
#update ⇒ Object
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 |