From e9f29831763225bea3206b9ce1766fe6b3593b2f Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 29 Jan 2013 22:17:00 +0800 Subject: [PATCH] Fix page part kind being removed --- app/controllers/admin/page_parts_controller.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 6442d2fc..21050985 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -56,14 +56,12 @@ class Admin::PagePartsController < ApplicationController def update @part = PagePart.find(params[:id]) - params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field] - params[:page_part][:widget_field_type] = nil - - if params[:page_part][:module_app].blank? - params[:page_part][:module_app] = nil - params[:page_part][:kind] = nil - end + params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field] + params[:page_part][:widget_field_type] = nil + if params[:page_part][:module_app].blank? + params[:page_part][:module_app] = nil + end if @part.update_attributes(params[:page_part]) set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') flash.now[:notice] = t('update.success.content')