From 147b7b9292d85a1da4be89de90c2e4ea82453483 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 7 Mar 2013 17:30:49 +0800 Subject: [PATCH] Fix update when no tag or category --- app/controllers/admin/pages_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index a5cba320..61d1e38e 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -93,14 +93,14 @@ helper Admin::PagePartsHelper @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id ) end - params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field] - params[:page][:frontend_field_type] = nil + params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field] + params[:page][:frontend_field_type] = nil - if params[:page][:tag].include?("nil") + if params[:page][:tag] && params[:page][:tag].include?("nil") params[:page][:tag] = [] end - if params[:page][:category].include?("nil") + if params[:page][:category] && params[:page][:category].include?("nil") params[:page][:category] = [] end