I need to set an HTML class to this rails select and i have tried many variations and nothing
<%= add.select :state,
@states.map { |s| [ s.name, s.abbr ] },
:class => 'state',
:include_blank => true
%>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe your
html_optionsshould go after youroptions. Also, since you’re specifying two hashes for your last two arguments, you should use curly braces to explicitly tell Ruby that they’re two separate hashes. Try this: