collection_check_boxes get value
- by 24sharon
this is my view code
<%=collection_check_boxes(nil, :admin_ids, Admin.all, :id, :name )%>
but when i try get the value in the controller i get always an empty value if the user doesnt check any item
and the length is always more than zero
when i write this code
arr = params[:admin_ids] ||= []
puts arr.length
ther arr.length is 1 even if the user doesnt select any of the items
how can i get an array of selected items only with no empty values