collection_selec Rails does not take CSS class

0

I am rendering a JS in rails but the colletion_select does not take me a class of css that I am placing.

name file: options.js.erb

var html = "<%= j(collection_select(:item_pro, :name, @items, :id, :name, {class: 'style-colletion'}))%>";
$('#act').html(html);
    
asked by Leonard J. Ávila S. 28.08.2017 в 16:41
source

1 answer

0

If you want to add a class to an element, you can use it in this way:

$('#act').addClass("style-colletion");
    
answered by 28.08.2017 / 17:01
source