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

@ -27,6 +27,8 @@ class FaqsController < ApplicationController
faq = Qa.can_display.find_by_param(params[:uid])
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|
{

View File

@ -10,7 +10,12 @@
<% @qas.each do |qa| %>
<tr>
<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>
<a href="#" target="_blank"><%= qa.title %></a>
<div class="quick-edit">