fix widget title

This commit is contained in:
JiangRu 2014-12-24 09:22:21 +08:00
parent 3100742e40
commit 1a1b79cc15
1 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,13 @@ class SiteMenuWidgetsController < ApplicationController
else
pages = page.parent_page.sorted_published_child_pages
end
page.page_parts.collect do |pp|
pp.sub_parts.collect do |sp|
@title = sp.title if sp.module == "site_menu_widget"
end
end
def create_json(pages)
items = []
pages.each do |page|
@ -41,10 +48,12 @@ class SiteMenuWidgetsController < ApplicationController
end
items
end
items = create_json(pages)
{
"pages" => items,
"extras" => {"widget_title" => "Sub Menu"}
"extras" => {"widget_title" => @title}
}
end