Consider this as my select tag
<%= select_tag \"post[brand_slug]\", options_from_collection_for_select(@products, \'slug\', \'name\'), prompt: \'select\' %>
Try following:
<%= select_tag "post[brand_slug]", options_for_select(@products.map{ |product| [product.name, product.slug, { 'data-id' => product.id }] }), prompt: 'select' %>