From 3b2f8277a476e0d8158229bee02c9c214b13f377 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Oct 2022 22:55:43 +0800 Subject: [PATCH] fix error --- .../admin/asks/_edit_box_for_index.html.erb | 9 +++++++++ app/views/admin/asks/_index.html.erb | 17 +++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 app/views/admin/asks/_edit_box_for_index.html.erb diff --git a/app/views/admin/asks/_edit_box_for_index.html.erb b/app/views/admin/asks/_edit_box_for_index.html.erb new file mode 100644 index 0000000..95240ca --- /dev/null +++ b/app/views/admin/asks/_edit_box_for_index.html.erb @@ -0,0 +1,9 @@ +
+ +
\ No newline at end of file diff --git a/app/views/admin/asks/_index.html.erb b/app/views/admin/asks/_index.html.erb index 74d1f46..9dfa6eb 100644 --- a/app/views/admin/asks/_index.html.erb +++ b/app/views/admin/asks/_index.html.erb @@ -188,7 +188,7 @@ situation_trans = AskTicketStatus.all.map{|a| [a.key, a.title]}.to_h last_serial_number = @ask_setting.last_serial_number display_length = [last_serial_number.to_s.length + 1, 4].max - edit_button_display_index = @table_fields.count > 3 ? 2 : @table_fields.count + edit_box_display_index = @table_fields.count > 3 ? 2 : @table_fields.count %> <% @askquestions.each do |b| %> @@ -196,17 +196,6 @@ ask_show_url = Page.where(:module=>'ask').first.url rescue nil edit_button_can_show = true %> - <% content_for :edit_button do %> -
- -
- <% end %> <% if is_editable %><% end %> <% @table_fields.each_with_index do |f,i| %> @@ -238,8 +227,8 @@ <% when 'ip' %> <%= b.ip %> <% end %> - <% if edit_button_display_index == i %> - <%= yield :edit_button %> + <% if edit_box_display_index == i %> + <%= render partial: 'edit_box_for_index', :locals => {is_editable: is_editable, b: b} %> <% end %> <% end %>