announcement-link-widget/app/controllers/announcement_link_widgets_c...

23 lines
489 B
Ruby
Raw Normal View History

2014-11-04 07:48:24 +00:00
require 'json'
2014-10-31 05:36:38 +00:00
class AnnouncementLinkWidgetsController < ApplicationController
def widget
2014-11-04 07:48:24 +00:00
data = {
"tags" => [{
"tag-name" => "",
"tag-id" => "",
2014-10-31 05:36:38 +00:00
"announcements" => [],
"links" => []
2014-11-04 07:48:24 +00:00
}],
2014-10-31 05:36:38 +00:00
"extras" => {
"heading-announcements" => "Announcements",
"heading-links" => "Links"
}
}
2014-11-04 07:48:24 +00:00
f = File.join(Rails.root, "public" , "announcement_link_widget.json")
if File.exists?(f)
2014-11-04 08:11:05 +00:00
contents = File.read(f)
2014-11-04 07:48:24 +00:00
data = JSON.parse(contents)
end
data
2014-10-31 05:36:38 +00:00
end
end