How to add a class to a number_field bound to model object

203 views Asked by At

No idea why this isn't working, have read through a lot of doc examples, most of those focus on text_field, maybe number_field is weird? I know that number_field doesn't accept a length option...

<%= form_for @person do |p| %>
  <%= p.number_field :zipcode, class: "short-number-field" %>
  ...
<% end %>

The html never renders with the class, how do I do this?

Note, this is not a number_field_tag, so the number of arguments is 2.

Thanks!

0

There are 0 answers