I am trying to display an array in drop down list using collection_select
. My array is:
"[\"\", \"Jacket\", \"Shirt\"]"
The code is below:
<%= form.collection_select(:parts, @parts, :to_s, include_blank: false,prompt:"Select the part" )%>
I get an error:
ActionView::Template::Error (undefined method `map' for "[\"\", \"jacket\", \"shirt\"]":String
Did you mean? tap):