Fix page part update when no tag or category

This commit is contained in:
chris 2013-03-07 17:30:49 +08:00
parent b864cc0268
commit e208e99a73
1 changed files with 3 additions and 3 deletions

View File

@ -59,17 +59,17 @@ class Admin::PagePartsController < ApplicationController
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type],params[:page_part][:widget_field_is_link] ) if params[:page_part][:widget_field]
params[:page_part][:widget_field_type] = nil
params[:page_part][:widget_field_is_link] = nil
params[:page_part][:widget_field_is_link] = nil
if params[:page_part][:module_app].blank?
params[:page_part][:module_app] = nil
end
if params[:page_part][:tag].include?("nil")
if params[:page_part][:tag] && params[:page_part][:tag].include?("nil")
params[:page_part][:tag] = []
end
if params[:page_part][:category].include?("nil")
if params[:page_part][:category] && params[:page_part][:category].include?("nil")
params[:page_part][:category] = []
end