From 28163dbeba4e092e6fd07f1f9c5f89e6452db7a7 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 15 Jan 2016 15:11:39 +0800 Subject: [PATCH] small fix for categories table --- app/controllers/admin/universal_tables_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/universal_tables_controller.rb b/app/controllers/admin/universal_tables_controller.rb index 690db3f..262e8f3 100644 --- a/app/controllers/admin/universal_tables_controller.rb +++ b/app/controllers/admin/universal_tables_controller.rb @@ -177,16 +177,16 @@ class Admin::UniversalTablesController < OrbitAdminController uid = params[:id].split("-").last p = table_params table = UTable.where(:uid => uid).first - table.update_attributes(p) - table.save cat = table.category rescue nil if cat.nil? cat = Category.new cat.module_app = @module_app - cat.save end cat.title_translations = p[:title_translations] cat.save + p[:category_id] = cat.id + table.update_attributes(p) + table.save redirect_to admin_universal_tables_path end