first version of multi categories and tags

This commit is contained in:
Fu Matthew authored and chris committed 2013-02-27 10:49:48 +08:00
1 parent 4bc3a57862
commit 99e67c8719
12 files changed
+110 -11

No files matched your search

@@ -54,6 +54,7 @@ class Admin::PagePartsController < ApplicationController
end
def update
binding.pry
@part = PagePart.find(params[:id])
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]
@@ -63,6 +64,17 @@ class Admin::PagePartsController < ApplicationController
if params[:page_part][:module_app].blank?
params[:page_part][:module_app] = nil
end
if params[:page_part][:tag].include?("nil")
params[:page_part][:tag] = []
end
if params[:page_part][:category].include?("nil")
params[:page_part][:category] = []
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')
@@ -96,6 +96,14 @@ helper Admin::PagePartsHelper
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")
params[:page][:tag] = []
end
if params[:page][:category].include?("nil")
params[:page][:category] = []
end
if @item.update_attributes(params[:page])
flash[:notice] = t('update.success.page')
respond_to do |format|