ajax load completed

This commit is contained in:
Harry Bomrah 2014-11-03 20:22:04 +08:00
parent 8f735ad024
commit b564c71b3d
2 changed files with 22 additions and 1 deletions

View File

@ -1,5 +1,12 @@
class AnnouncementLinkWidgetsController < ApplicationController class AnnouncementLinkWidgetsController < ApplicationController
layout false
def widget def widget
{
"extras" => {}
}
end
def render_content
announcement_app = ModuleApp.find_by_key("announcement") announcement_app = ModuleApp.find_by_key("announcement")
link_app = ModuleApp.find_by_key("web_resource") link_app = ModuleApp.find_by_key("web_resource")
OrbitHelper.override_widget_module_app("announcement") OrbitHelper.override_widget_module_app("announcement")
@ -62,5 +69,12 @@ class AnnouncementLinkWidgetsController < ApplicationController
"heading-links" => "Links" "heading-links" => "Links"
} }
} }
end
def content
OrbitHelper.register_subpart(params["sub_part_id"])
html = render_widget_for_frontend("announcement_link_widget","render_content","content")
render :html => html.html_safe
end end
end end

View File

@ -1,2 +1,9 @@
AnnouncementLinkWidget::Engine.routes.draw do Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales
# scope "(:locale)", locale: Regexp.new(locales.join("|")) do
get "/xhr/announcement_link_widget/content" => "announcement_link_widgets#content"
# end
end end