[英]How to add class attribute to select tag in rails 3
I want to add class attribute to select tag in rails 3 my code is 我想在我的代码中使用rails 3中的class属性添加class属性
<div >
<%= f.label :type %><br />
<%= f.select "type_id", options_from_collection_for_select(@type,
"type_id","name"),:include_blank=>true%>
</div>
My problem is that I want to add one specific class name to this select tag for validation purpose. 我的问题是我想为这个select标签添加一个特定的类名以进行验证。 I tried adding
我尝试添加
:class=>"myclassname"
but it not worked for me.plz resolve my issue 但它对我不起作用。解压我的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.