Render layout to import the trades.
# File app/controllers/admin/trades_controller.rb, line 6 def import render :layout => false end
Import csv file for trades and save it in database.
# File app/controllers/admin/trades_controller.rb, line 11 def import_csv if params[:file].present? Trade.dump_into_database(params[:file]) redirect_to admin_trades_path, notice: "File imported Successfully." else redirect_to admin_trades_path end end
Render layout to import the subtrades.
# File app/controllers/admin/trades_controller.rb, line 21 def import_subtrades render :layout => false end
Import csv file for subtrades and save it in database.
# File app/controllers/admin/trades_controller.rb, line 26 def import_subtrades_csv if params[:file].present? Trade.insert_subtrades_data_into_database(params[:file]) redirect_to admin_trades_path, notice: "File imported Successfully." else redirect_to admin_trades_path end end