category fix

This commit is contained in:
Harry Bomrah 2014-12-11 17:48:10 +08:00
parent 96955d968e
commit 6ec3bd1892
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,8 @@ class FaqsController < ApplicationController
url_to_edit = OrbitHelper.user_can_edit?(faq) ? "/admin/faqs/#{faq.id.to_s}/edit" : "" url_to_edit = OrbitHelper.user_can_edit?(faq) ? "/admin/faqs/#{faq.id.to_s}/edit" : ""
return {} if (faq.category.disable rescue false)
faqs_files = faq.qa_files.collect do |f| faqs_files = faq.qa_files.collect do |f|
{ {
"file_url" => f.file.url, "file_url" => f.file.url,

View File

@ -10,7 +10,12 @@
<% @qas.each do |qa| %> <% @qas.each do |qa| %>
<tr> <tr>
<td><%= qa.status_for_table %></td> <td><%= qa.status_for_table %></td>
<td><%= qa.category.title %></td> <td>
<%= qa.category.title rescue "" %>
<% if (qa.category.disable rescue false) %>
<span class='label'><%= t(:disabled) %></span>
<% end %>
</td>
<td> <td>
<a href="#" target="_blank"><%= qa.title %></a> <a href="#" target="_blank"><%= qa.title %></a>
<div class="quick-edit"> <div class="quick-edit">