Select Tag with class in Rails
If you wish to give your select field a class, it is necessary to give the second argument, even when empty.
<%= f.select(:gender, [ 'Male', 'Female' ], {}, { :class => 'select' }) %>
Written by Cassio Cabral
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#