Fix missing params category value

This commit is contained in:
Bernie Chiu 2013-12-13 15:39:19 +08:00 committed by saurabhbhatia
parent 0ab7041341
commit eb638995f0
1 changed files with 2 additions and 0 deletions

View File

@ -103,6 +103,8 @@ class Admin::PagePartsController < OrbitBackendController
def update def update
@part = PagePart.find(params[:id]) @part = PagePart.find(params[:id])
# Sometimes category is passed into params[:page], so this line makes sure it will also be in params[:page_part] too
params[:page_part][:category] ||= params[:page][:category]
if @part.update_attributes(params[:page_part]) if @part.update_attributes(params[:page_part])
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
flash.now[:notice] = t('update.success.content') flash.now[:notice] = t('update.success.content')