update option and menu export csv single

This commit is contained in:
Aung Myo
2018-03-16 17:41:30 +06:30
parent f0e81caad0
commit e956b54886
14 changed files with 84 additions and 183 deletions

View File

@@ -7,9 +7,12 @@ class Settings::MenusController < ApplicationController
def index
@settings_menus = Menu.all.page(params[:page]).per(10)
respond_to do |format|
format.html
format.csv { send_data Menu.to_csv }
end
format.html
# format.csv { send_data MenuCsvExport.generate }
format.csv { send_data Menu.to_csv }
# format.csv { send_data MenuCategory.to_csv }
end
end
# GET /settings/menus/1
@@ -71,6 +74,11 @@ class Settings::MenusController < ApplicationController
# end
end
def import
Menu.import(params[:file])
redirect_to settings_menu_path, notice: "imported"
end
private
# Use callbacks to share common setup or constraints between actions.
def set_settings_menu