You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.
i wasn't really satisfied with the given example about the view ... (typing plain HTMl isn't really the rails way ;) )
i found this - well also not really satisfying - solution:
{code}
<% i = 0 %>
<% for role in Person.values_for_roles do %>
<%= check_box_tag "person[roles][]", role, @person.roles.include?(role), {:id => "person_roles_" + (i+=1).to_s } %>
<%= f.label "roles_" + i.to_s, role.to_s.titleize %>
<% end %>
{code}
As far as i see, collection_check_boxes can't be used, too (expects a collection of objects)
Are there any better solutions out there?
Or is there for the default form helpers anything missing?
Or had i just been blind and missed something`?
Could you please provide an example in the DOC?
(PS.: i'm at the start of creating an application, and still not sure, which bitmask booleans in the end will be needed ... so, i'm really interested in just editing the model and not the views, too - in case of ;) )
The text was updated successfully, but these errors were encountered:
Hi there,
i wasn't really satisfied with the given example about the view ... (typing plain HTMl isn't really the rails way ;) )
i found this - well also not really satisfying - solution:
{code}
<% i = 0 %>
<% for role in Person.values_for_roles do %>
<%= check_box_tag "person[roles][]", role, @person.roles.include?(role), {:id => "person_roles_" + (i+=1).to_s } %>
<%= f.label "roles_" + i.to_s, role.to_s.titleize %>
<% end %>
{code}
As far as i see, collection_check_boxes can't be used, too (expects a collection of objects)
Are there any better solutions out there?
Or is there for the default form helpers anything missing?
Or had i just been blind and missed something`?
Could you please provide an example in the DOC?
(PS.: i'm at the start of creating an application, and still not sure, which bitmask booleans in the end will be needed ... so, i'm really interested in just editing the model and not the views, too - in case of ;) )
The text was updated successfully, but these errors were encountered: