update option and menu export csv single
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user