diff --git a/app/controllers/faqs_controller.rb b/app/controllers/faqs_controller.rb index c0f4cc2..53797fe 100644 --- a/app/controllers/faqs_controller.rb +++ b/app/controllers/faqs_controller.rb @@ -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| { diff --git a/app/views/admin/faqs/_index.html.erb b/app/views/admin/faqs/_index.html.erb index f343445..4c8dc9d 100644 --- a/app/views/admin/faqs/_index.html.erb +++ b/app/views/admin/faqs/_index.html.erb @@ -10,7 +10,12 @@ <% @qas.each do |qa| %> <%= qa.status_for_table %> - <%= qa.category.title %> + + <%= qa.category.title rescue "" %> + <% if (qa.category.disable rescue false) %> + <%= t(:disabled) %> + <% end %> + <%= qa.title %>