first version of multi categories and tags

This commit is contained in:
Fu Matthew committed 2013-02-22 16:32:05 +08:00
1 parent 96455f31e1
commit b315215bed
12 files changed
+142 -34

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] )
@@ -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')
@@ -97,6 +97,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|