status for widget

This commit is contained in:
Harry Bomrah 2014-06-19 17:57:08 +08:00
parent 013c8c46cf
commit dfe13c1ffb
1 changed files with 8 additions and 1 deletions

View File

@ -47,10 +47,17 @@ class FaqsController < ApplicationController
def widget def widget
faqs = Qa.filter_by_widget_categories.collect do |qa| faqs = Qa.filter_by_widget_categories.collect do |qa|
statuses = qa.statuses_with_classname.collect do |status|
{
"status" => status["name"],
"status-class" => "status-#{status['classname']}"
}
end
{ {
"link_to_show" => OrbitHelper.widget_item_url(qa.to_param), "link_to_show" => OrbitHelper.widget_item_url(qa.to_param),
"title" => qa.title, "title" => qa.title,
"postdate" => qa.created_at.strftime('%Y-%m-%d %H:%M') "postdate" => qa.created_at.strftime('%Y-%m-%d %H:%M'),
"statuses" => statuses
} }
end end
{ {