From 3100742e40cf8c84743ad7891261385925523eb2 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Thu, 18 Dec 2014 16:41:34 +0800 Subject: [PATCH] reset controller --- app/controllers/site_menu_widgets_controller.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/app/controllers/site_menu_widgets_controller.rb b/app/controllers/site_menu_widgets_controller.rb index b65ce1d..a1aeb0a 100644 --- a/app/controllers/site_menu_widgets_controller.rb +++ b/app/controllers/site_menu_widgets_controller.rb @@ -8,10 +8,8 @@ class SiteMenuWidgetsController < ApplicationController else pages = page.parent_page.sorted_published_child_pages end - def create_json(pages) items = [] - widget_title = [] pages.each do |page| item = {} if page.child_page.size > 0 @@ -43,21 +41,11 @@ class SiteMenuWidgetsController < ApplicationController end items end - - - page_part_id = PagePart.where(:page_id => pages.first.parent_page_id).last.id - - widgets = SubPart.where(:page_part_id => page_part_id).collect do |sp| - { - "widget_title" => sp.title - } - end - items = create_json(pages) { "pages" => items, - "widget_title" => widgets + "extras" => {"widget_title" => "Sub Menu"} } - + end end \ No newline at end of file