update menu import and export
This commit is contained in:
@@ -7,12 +7,9 @@ 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 MenuCsvExport.generate }
|
||||
|
||||
format.csv { send_data Menu.to_csv }
|
||||
# format.csv { send_data MenuCategory.to_csv }
|
||||
end
|
||||
format.html
|
||||
format.xlsx
|
||||
end
|
||||
end
|
||||
|
||||
# GET /settings/menus/1
|
||||
@@ -76,7 +73,7 @@ format.csv { send_data Menu.to_csv }
|
||||
|
||||
def import
|
||||
Menu.import(params[:file])
|
||||
redirect_to settings_menu_path, notice: "imported"
|
||||
redirect_to settings_menus_path, notice: "imported"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user