Forum: Ruby on Rails Syntax to invoke form.check_box for elements of a hash

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
jhwinters (Guest)
on 2007-05-14 22:02
(Received via mailing list)
I have a model which contains a hash of boolean items, like this:

@role_flags={"Owner"=>0, "Administrator"=>0, "User"=>0, "Teacher"=>0,
"HoD"=>0, "Timetabler"=>0}

I would like to use form.check_box to generate check_box fields for
each item but I can't work out the way to pass the individual entries
in the hash to form.check_box - neither the Pragmatic book nor the
Rails on-line documentation seems to cover it.

I'm pretty new to Ruby so please excuse me if this is a very stupid
question, but can someone give me a pointer please?

This topic is locked and can not be replied to.