I don't know why it is printing out an array. I used the same method for another checkbox and it doesn't print out an array.
This is the code for the view
<%= f.label "Category: " %>
<%= Category.all.each do |category| %>
<%= check_box_tag "course[category_ids][]", category.id %>
<%= category.cat_name %>
<% end %>
and this is what it prints:
Programming [#<Category id: 1, cat_name: "Programming", created_at: "2017-05-25 02:25:24", updated_at: "2017-05-25 02:25:24">]
Is there a way to remove the array?