Per the documentation, the method signature for select
is:
select(object, method, choices, options = {}, html_options = {})
html_options
, which is where your HTML attribute options like :class
should go, comes after options
, but you're omitting options
and putting html_options
right after choices
. Try this instead:
<%= f.select :customer_type, options_for_select(["Retail","Contractor","Dealer"]), {}, class: "form-control" %>
P.S. If you're wondering why the method signature specifies object
, but in actual use we never pass object
(method
is always first), it's because we're not actually calling this method directly. When we call f.select(...)
inside a form_for
block, Rails calls select(f.object, ...)
for us.