0
partial_name = ((not group_data[:partial].nil?) && group_data[:partial]) || "basic_form_render";
我不斷收到錯誤「不能轉換成符號整數」。我計算過,因爲我傳遞組名和group_data的三個實例的時間,所以我加在.times一個變量看,以跟蹤每個互爲作用(0,1,2),如
partial_name = ((not group_data[times_iterator][:partial].nil?) && group_data[times_iterator][:partial]) || "basic_form_render";
迭代器初始化爲0的時間以及每次通過3次循環時遞增。但是,我仍然遇到同樣的錯誤。有任何想法嗎?
-form_data.each_with_index do |(category_name, cat_data), i|
-cat_data.each_slice(3).with_index do |(group_name, group_data), j|
- counter+=1
%div{:id => "page#{(counter)}", "data-role" => "page"}
%h3{:style => "text-align:center;"}
=category_name
%hr{:color => "black", :size => "2"}/
-3.times do
-partial_name = ((not group_data[:partial].nil?) && group_data[:partial]) || "basic_form_render";
= render partial_name, :cat_no => (i+1), :group_no => (j+times_iterator), :group_name => group_name, :group_data => group_data
=render "shared/form_footer"