Why isn't this checkbox working? please help!

The check boxes created by check_box are not checked when they should be
:

This code should produce lines of checked checkboxes and the word “true”
next to each of the checkboxes.
But it produces lines of unchecked checkboxes with “true” next to each
checkbox.

<% for report_test_and_name in report_suite.report_test_and_names %>
<%=report_test_and_name.test? %>
<%=check_box “report_test_and_name”,“test?” %>


<% end %>

I don’t get it, it doesn’t make sense. Surely if
report_test_and_name.test? returns true then
checkbox(“report_test_and_name”,“test?”) should return a checked
checkbox?

Any help would be appreciated as I’m tearing my hair out with this one.

Thanks
Chris

I’ve solved it, check_box will only work with instance variables, so i
needed to change <% for report_test_and_name in
report_suite.report_test_and_names %>

to <% for @report_test_and_name in report_suite.report_test_and_names %>