i want to display checkbox buttons to subcategory in ruby with its parent and child in ruby
like this
`category
checkbox subcategory
checkbox subcategory
category
checkbox subcategory
checkbox subcategory
category
checkbox subcategory
checkbox subcategory`
This is my code .
` <% Category.all.each do |c| %>
<%= check_box_tag "category_ids[]", c.id, :id => "category_ids_#{c.id}" %>
<%= c.name%>
<% end %>`
please modify this . here i am getting every category and sub category with checked option. i want checkbox only to subcategories.
Aucun commentaire:
Enregistrer un commentaire