Numeric field Simple_form_for

依然范特西╮ 提交于 2019-12-04 13:14:25

问题


In my numeric fields when using Simple_form_for, scroll bars are showed on the side of the fields when using Google Chrome.

How can I stop them from showing?


回答1:


Seeing some code would be helpful, but

They're not scrollbars; they're up and down arrow buttons to increment/decrement the number input field the specified step (defaults to 1). Learn more about the number input type

An integer attribute for your model by default will be rendered with type="number" as a field using simple_form.

To override this behavior, specify the type of input for the field using the :as option.

<%= f.input :your_field_name, as: :string %>

(This is documented in the README.md)



来源:https://stackoverflow.com/questions/13709950/numeric-field-simple-form-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!