links/app/controllers/web_resources_controller.rb

32 lines
623 B
Ruby

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