Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numeric field Simple_form_for

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?

Image showing numeric fields with Scroll Simple_form_for

like image 580
zurik Avatar asked Dec 04 '12 18:12

zurik


Video Answer


1 Answers

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)

like image 103
deefour Avatar answered Nov 15 '22 16:11

deefour