Commit e4b95145 by liyijie

import & export **options use params symbolize_keys

parent 565e030f
...@@ -48,12 +48,12 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -48,12 +48,12 @@ class SimpleController::BaseController < ::InheritedResources::Base
def import def import
xlsx_file = params[:file] || importable_class.import_excel_klass.new(params[:uid]) xlsx_file = params[:file] || importable_class.import_excel_klass.new(params[:uid])
response = importable_class.import_xlsx(xlsx_file, collection, **params.to_unsafe_h) response = importable_class.import_xlsx(xlsx_file, collection, **params.to_unsafe_h.symbolize_keys)
render json: response, status: 201 render json: response, status: 201
end end
def export def export
url = exportable_class.export_xlsx collection, **params.to_unsafe_h url = exportable_class.export_xlsx collection, **params.to_unsafe_h.symbolize_keys
render json: { url: url }, status: 201 render json: { url: url }, status: 201
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment