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

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo