require 'json' class AnnouncementLinkWidgetsController < ApplicationController def widget data = { "tags" => [{ "tag-name" => "", "tag-id" => "", "announcements" => [], "links" => [] }], "extras" => { "heading-announcements" => "Announcements", "heading-links" => "Links" } } f = File.join(Rails.root, "public" , "announcement_link_widget.json") if File.exists?(f) contents = File.read(f) data = JSON.parse(contents) end data end end