ruby - rails: adding css class to a select box -


how add css class select box?

i have code

<%= select_tag(:ptype, options_for_select(tourparticipation::ptypes, selected: "traveler", disabled: "role:", :class =>  "widens")) %> 

which doesn't work.

you have closing parenthesis in wrong place. need pass class option select_tag, not options_for_select. want this:

<%= select_tag(:ptype, options_for_select(tourparticipation::ptypes, selected: "traveler", disabled: "role:"), :class =>  "widens") %> 

Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

c# - Randomly pick a specific int from a 2D Array -

php - Angularjs http.delete is not working after deploying project on server -