From 864ca461263745fdeb58f059964949ebb4dbff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 1 Sep 2022 10:42:50 +0800 Subject: [PATCH] fix error --- app/views/announcements/index.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/announcements/index.html.erb b/app/views/announcements/index.html.erb index 2d923a1..a6aed5f 100644 --- a/app/views/announcements/index.html.erb +++ b/app/views/announcements/index.html.erb @@ -1,3 +1,8 @@ +<% tmp = render_view %> +<% @params = @index_controller.instance_variable_get(:@params) rescue {} + @enable_search_flag = @index_controller.instance_variable_get(:@enable_search_flag) rescue false +%> + <% if @enable_search_flag %>
- <% cats = Array(page.categories) + <% cats = Array(@page.categories) if cats.include? 'all' cats = ModuleApp.where(key: 'announcement').first.categories else @@ -65,4 +70,4 @@
<% end %> -<%= render_view %> \ No newline at end of file +<%= tmp %> \ No newline at end of file