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
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 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 %>
<input type="hidden" name="person[roles][]" value="none">
{code}
Are there any better solutions out there?
Or are there for the default form helpers anything missing?
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 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 %>
<input type="hidden" name="person[roles][]" value="none">
{code}
Are there any better solutions out there?
Or are there for the default form helpers anything missing?
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: