I want create a checkbox group and need to check some checkboxes.
$user
is a list of all "Users". The method $activity->users(u_id)
check if the user is "active" and return 1/0. But it doesn't matter what it return, the checkbox is always checked if I use this code:
% $user->foreach( sub {
% my $checked = $activity->users($_[0]->u_id) ? 'checked' : '';
<span><%= check_box 'users' => $_[0]->u_id, checked => $checked %>
%= $_[0]
%= $checked
</span>
% });
The documentation unfortunatly doesn't explain how it is right and I also didn't found any other site which explain how it should be.