added statuses to the links and also context

This commit is contained in:
Harry Bomrah 2014-06-06 17:33:53 +08:00
parent 3119d17b44
commit 4a50726150
1 changed files with 8 additions and 0 deletions

View File

@ -3,8 +3,16 @@ class WebResourcesController < ApplicationController
def index def index
links = WebLink.order_by(:created_at=>'desc') links = WebLink.order_by(:created_at=>'desc')
web_link = links.collect do |link| web_link = links.collect do |link|
statuses = link.statuses.collect do |status|
{
"status" => status,
"status-class" => "status-#{status.downcase}"
}
end
{ {
"title" => link.title, "title" => link.title,
"context" => link.context,
"statuses" => statuses,
"link_to_show" => link.url "link_to_show" => link.url
} }
end end