links/app/controllers/web_resources_controller.rb

32 lines
623 B
Ruby
Raw Normal View History

2014-05-05 11:33:35 +00:00
class WebResourcesController < ApplicationController
def index
links = WebLink.order_by(:created_at=>'desc')
web_link = links.collect do |link|
{
"title" => link.title,
"link_to_show" => link.url
}
end
{
"data" => web_link,
"extras" => {"widget-title"=>"Web Resource"}
}
end
def widget
links = WebLink.order_by(:created_at=>'desc')
web_link = links.collect do |link|
{
"title" => link.title,
"link_to_show" => link.url
}
end
{
"data" => web_link,
"extras" => {"widget-title"=>"Web Resource"}
}
end
end