Hi I have the following code on my view:
//I write a loop here to display some workflows saying wkf.each do |i|
<% if (i write my condition here) %>
<td style="text-align:left;">
<%= f.check_box :i, {:checked=>true}%>
<%= f.label(i, i)%>
</td></tr>
<% else %>
<td style="text-align:left;">
<%= f.check_box(i)%>
<%= f.label(i, i)%>
</td></tr>
<%end%>
Suppose that there are three workflows 'A', 'B' and 'C' and 'C' meets the if condition, then the parameters being sent are 'A'=>0, 'B'=>0 and 'i'=>'1'. I want it to be sent as 'C'=>'1' in the same way as 'A'=>0.
I know that 'i' =>'1'
is sent because i wrote f.check_box :i, {:checked=>true}
% instead of
<%= f.check_box(i)%>
.
Please let me know how to change this so that, the check box is checked by default when the if condition is met and the #{i}
would be sent instead of :i
Thanks